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§
Source§impl<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§
Auto Trait Implementations§
impl<Meta> Freeze for ObjectMap<Meta>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more