Struct wayland_commons::map::ObjectMap
source · [−]pub struct ObjectMap<Meta: ObjectMetadata> { /* private fields */ }
Expand description
A holder for the object store of a connection
Keeps track of which object id is associated to which interface object, and which is currently unused.
Implementations
sourceimpl<Meta: ObjectMetadata> ObjectMap<Meta>
impl<Meta: ObjectMetadata> ObjectMap<Meta>
sourcepub fn remove(&mut self, id: u32)
pub fn remove(&mut self, id: u32)
Remove an object from the store
Does nothing if the object didn’t previously exists
sourcepub fn insert_at(&mut self, id: u32, object: Object<Meta>) -> Result<(), ()>
pub fn insert_at(&mut self, id: u32, object: Object<Meta>) -> Result<(), ()>
Insert given object for given id
Can fail if the requested id is not the next free id of this store. (In which case this is a protocol error)
sourcepub fn client_insert_new(&mut self, object: Object<Meta>) -> u32
pub fn client_insert_new(&mut self, object: Object<Meta>) -> u32
Allocate a new id for an object in the client namespace
sourcepub fn server_insert_new(&mut self, object: Object<Meta>) -> u32
pub fn server_insert_new(&mut self, object: Object<Meta>) -> u32
Allocate a new id for an object in the server namespace
Trait Implementations
sourceimpl<Meta: Debug + ObjectMetadata> Debug for ObjectMap<Meta>
impl<Meta: Debug + ObjectMetadata> Debug for ObjectMap<Meta>
Auto Trait Implementations
impl<Meta> RefUnwindSafe for ObjectMap<Meta> where
Meta: RefUnwindSafe,
impl<Meta> Send for ObjectMap<Meta> where
Meta: Send,
impl<Meta> Sync for ObjectMap<Meta> where
Meta: Sync,
impl<Meta> Unpin for ObjectMap<Meta> where
Meta: Unpin,
impl<Meta> UnwindSafe for ObjectMap<Meta> where
Meta: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more