pub struct ConcurrencyPermit { /* private fields */ }Expand description
Leak-proof RAII concurrency permit stored in Hyperlane Context under ATTR_CONCURRENCY_PERMIT.
Cloning shares the same underlying permit handle; calling ConcurrencyPermit::release or
dropping the final reference atomically releases the in-flight slot exactly once.
Implementations§
Source§impl ConcurrencyPermit
Inherent release and inspection helpers for ConcurrencyPermit.
impl ConcurrencyPermit
Inherent release and inspection helpers for ConcurrencyPermit.
Sourcepub fn is_released(&self) -> bool
pub fn is_released(&self) -> bool
Sourcepub fn from_context(ctx: &Context) -> Option<Self>
pub fn from_context(ctx: &Context) -> Option<Self>
Retrieves the active ConcurrencyPermit stored in ctx, if present.
§Arguments
&Context- Active Hyperlane context.
§Returns
Option<Self>- Permit handle when present.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ConcurrencyPermit
impl !UnwindSafe for ConcurrencyPermit
impl Forget for ConcurrencyPermit
impl Freeze for ConcurrencyPermitwhere
*const ArcInner<ConcurrencyPermitInner> is !null: Freeze,
PhantomData<ArcInner<ConcurrencyPermitInner>>: Freeze,
impl Move for ConcurrencyPermit
impl Send for ConcurrencyPermit
impl Sync for ConcurrencyPermit
impl Unpin for ConcurrencyPermit
impl UnsafeUnpin for ConcurrencyPermitwhere
*const ArcInner<ConcurrencyPermitInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<ConcurrencyPermitInner>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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