Struct smithay::wayland::compositor::MultiCache[][src]

pub struct MultiCache { /* fields omitted */ }
Expand description

A typemap-like container for double-buffered values

All values inserted into this container must implement the Cacheable trait, which defines their buffering semantics. They furthermore must be Send as the surface state can be accessed from multiple threads (but Sync is not required, the surface internally synchronizes access to its state).

Consumers of surface state (like compositor applications using Smithay) will mostly be concerned with the MultiCache::current method, which gives access to the current state of the surface for a particular type.

Writers of protocol extensions logic will mostly be concerned with the MultiCache::pending method, which provides access to the pending state of the surface, in which new state from clients will be stored.

This contained has RefCell-like semantics: values of multiple stored types can be accessed at the same time. The stored values are initialized lazily the first time current() or pending() are invoked with this type as argument.

Implementations

Access the pending state associated with type T

Access the current state associated with type T

Check if the container currently contains values for type T

Trait Implementations

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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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.