Skip to main content

ProviderContextPinSource

Trait ProviderContextPinSource 

Source
pub trait ProviderContextPinSource:
    Send
    + Sync
    + Debug {
    // Required methods
    fn context(&self) -> ProviderContextIdentity;
    fn pin(
        &self,
    ) -> Result<Box<dyn ProviderContextPin>, ProviderContextPinError>;
}
Expand description

Something that can hand out ProviderContextPins for one context.

Required Methods§

Source

fn context(&self) -> ProviderContextIdentity

Which context this source pins.

Source

fn pin(&self) -> Result<Box<dyn ProviderContextPin>, ProviderContextPinError>

Claim the context until the returned pin is dropped.

Fails when the context is no longer accepting work. Callers must treat a failure as a refusal to queue the deferred release, not as a reason to proceed unpinned.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§