pub struct HandleMgr<ServerData> { /* private fields */ }
Expand description
A manager for open handles, per compartment.
Implementations§
Source§impl<ServerData> HandleMgr<ServerData>
impl<ServerData> HandleMgr<ServerData>
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Get the total number of open handles across all compartments.
Sourcepub fn open_count(&self, comp: ObjID) -> usize
pub fn open_count(&self, comp: ObjID) -> usize
Get the number of currently open handles for a given compartment.
Sourcepub fn lookup(&self, comp: ObjID, ds: Descriptor) -> Option<&ServerData>
pub fn lookup(&self, comp: ObjID, ds: Descriptor) -> Option<&ServerData>
Lookup the server data associated with a descriptor.
Sourcepub fn lookup_mut(
&mut self,
comp: ObjID,
ds: Descriptor,
) -> Option<&mut ServerData>
pub fn lookup_mut( &mut self, comp: ObjID, ds: Descriptor, ) -> Option<&mut ServerData>
Lookup the server data associated with a descriptor.
Sourcepub fn insert(&mut self, comp: ObjID, sd: ServerData) -> Option<Descriptor>
pub fn insert(&mut self, comp: ObjID, sd: ServerData) -> Option<Descriptor>
Insert new server data, and return a descriptor for it.
Sourcepub fn remove(&mut self, comp: ObjID, ds: Descriptor) -> Option<ServerData>
pub fn remove(&mut self, comp: ObjID, ds: Descriptor) -> Option<ServerData>
Remove a descriptor, returning the server data if present.
Trait Implementations§
Auto Trait Implementations§
impl<ServerData> !Crossing for HandleMgr<ServerData>
impl<ServerData> Freeze for HandleMgr<ServerData>
impl<ServerData> !ObjSafe for HandleMgr<ServerData>
impl<ServerData> RefUnwindSafe for HandleMgr<ServerData>where
ServerData: RefUnwindSafe,
impl<ServerData> Send for HandleMgr<ServerData>where
ServerData: Send,
impl<ServerData> Sync for HandleMgr<ServerData>where
ServerData: Sync,
impl<ServerData> Unpin for HandleMgr<ServerData>
impl<ServerData> UnwindSafe for HandleMgr<ServerData>where
ServerData: RefUnwindSafe,
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