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
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for MultiCache
impl Send for MultiCache
impl !Sync for MultiCache
impl Unpin for MultiCache
impl !UnwindSafe for MultiCache
Blanket Implementations
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
pub fn vzip(self) -> V