pub struct CapabilityRegistry { /* private fields */ }Implementations§
Source§impl CapabilityRegistry
impl CapabilityRegistry
pub fn new( session_generation: SessionGeneration, ledger: Arc<ResourceLedger>, ) -> Self
pub fn session_generation(&self) -> SessionGeneration
pub fn resources(&self) -> Arc<ResourceLedger> ⓘ
Sourcepub fn reserve(
&self,
kind: CapabilityKind,
) -> Result<PendingCapability, CapabilityError>
pub fn reserve( &self, kind: CapabilityKind, ) -> Result<PendingCapability, CapabilityError>
Acquire every count permit before allocating the descriptor/backend.
Sourcepub async fn reserve_when_available(
&self,
kind: CapabilityKind,
) -> Result<PendingCapability, CapabilityError>
pub async fn reserve_when_available( &self, kind: CapabilityKind, ) -> Result<PendingCapability, CapabilityError>
Pause an async source at admission instead of accepting/reading and then queueing uncharged state. The notification is armed before each retry so a concurrent release cannot be missed.
pub fn snapshot(&self, id: CapabilityId) -> Option<CapabilitySnapshot>
pub fn snapshots(&self) -> Vec<CapabilitySnapshot>
pub fn close_admission(&self) -> Result<(), CapabilityError>
pub fn active_len(&self) -> usize
pub fn outstanding_len(&self) -> usize
pub async fn wait_empty(&self)
Trait Implementations§
Source§impl Clone for CapabilityRegistry
impl Clone for CapabilityRegistry
Source§fn clone(&self) -> CapabilityRegistry
fn clone(&self) -> CapabilityRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CapabilityRegistry
impl RefUnwindSafe for CapabilityRegistry
impl Send for CapabilityRegistry
impl Sync for CapabilityRegistry
impl Unpin for CapabilityRegistry
impl UnsafeUnpin for CapabilityRegistry
impl UnwindSafe for CapabilityRegistry
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