pub struct IdAllocator { /* private fields */ }
Expand description

An allocator for X11 IDs.

This struct handles the client-side generation of X11 IDs. The ID allocation is based on a range of IDs that the server assigned us. This range is described by a base and a mask. From the X11 protocol reference manual:

The resource-id-mask contains a single contiguous set of bits (at least 18). The client allocates resource IDs [..] by choosing a value with only some subset of these bits set and ORing it with resource-id-base.

Implementations

Create a new instance of an ID allocator.

The arguments should be the resource_id_base and resource_id_mask values that the X11 server sent in a Setup response.

Update the available range of IDs based on a GetXIDRangeReply

Generate the next ID.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.