Skip to main content

ProviderSession

Struct ProviderSession 

Source
pub struct ProviderSession<P> { /* private fields */ }
Expand description

One explicitly selected backend session with stable nonzero-sized ownership.

This owns the adapter, not a global registry or cryptographic engine. A borrowed adapter may itself hold the caller’s existing engine/policy. Its address remains stable while finalized outputs or challenges borrow it. Distinct selections remain distinct even for zero-sized stateless adapters. There is no implicit Clone, allocation or synchronization requirement.

Implementations§

Source§

impl<P> ProviderSession<P>

Source

pub const fn new(backend: P) -> Self

Creates a distinct selection owner before resolving any document input.

Source

pub const fn backend(&self) -> &P

The selected adapter; this accessor does not transfer session provenance.

Source

pub fn same_session(&self, other: &Self) -> bool

Identity of the live selection owner, even when both adapters are ZSTs.

Trait Implementations§

Source§

impl<P: Debug> Debug for ProviderSession<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P> Deref for ProviderSession<P>

Source§

type Target = P

The resulting type after dereferencing.
Source§

fn deref(&self) -> &P

Dereferences the value.
Source§

impl<'a, P: DigestProvider<'a>> DigestProvider<'a> for ProviderSession<P>

Source§

type Error = <P as DigestProvider<'a>>::Error

Original callback failure, including that provider’s resource refusal.
Source§

type Identity = <P as DigestProvider<'a>>::Identity

Fully resolved digest identity.
Source§

type State = <P as DigestProvider<'a>>::State

Digest state, independently movable from its identity object.
Source§

type Output = <P as DigestProvider<'a>>::Output

Final output, inline or retaining its own admitted allocation charge.
Source§

fn resolve_digest( &'a self, algorithm: DigestAlgorithm<'a>, encoding: Encoding, parent: &Reader<'a>, ) -> Result<Resolution<Self::Identity>, Self::Error>

Resolves original parameters under their producing encoding/work domain.
Source§

fn compare_digest<W: Work>( &self, left: &Self::Identity, right: &Self::Identity, work: &W, ) -> Result<Ordering, Self::Error>

Compares full resolved identities after admitting any parameter traversal.
Source§

fn digest_width(&self, identity: &Self::Identity) -> Option<usize>

Expected fixed output width, or None for an identity without a fixed width. This is O(1) metadata access on the already resolved identity, not parsing.
Source§

fn start_digest<W: Work>( &'a self, identity: &Self::Identity, work: &W, ) -> Result<Self::State, Self::Error>

Initializes a state without borrowing the address of identity.
Source§

fn update_digest<W: Work>( &self, state: &mut Self::State, bytes: &[u8], work: &W, ) -> Result<(), Self::Error>

Admits and processes each complete logical chunk exactly once.
Source§

fn finish_digest<W: Work>( &self, state: Self::State, work: &W, ) -> Result<Self::Output, Self::Error>

Consumes a completed state once; no opaque state cloning or repeated finish.
Source§

fn matches_digest<W: Work>( &self, digest: Prehash<'_, '_, Self, Self::Identity>, expected: &[u8], work: &W, ) -> Result<bool, Self::Error>

Compares completed bytes with a declared imprint, without hashing again. Read more
Source§

impl<'a, P: SignatureProvider<'a>> SignatureProvider<'a> for ProviderSession<P>

Source§

type SignatureIdentity = <P as SignatureProvider<'a>>::SignatureIdentity

Fully resolved signature identity, including algorithm-specific defaults.
Source§

type RawState = <P as SignatureProvider<'a>>::RawState

Raw verification state, initialized with original signature/key first.
Source§

fn resolve_signature( &'a self, algorithm: AlgorithmIdentifier<'a>, digest: &Self::Identity, key: WorkingKey<'a>, encoding: Encoding, parent: &Reader<'a>, ) -> Result<Resolution<SignatureMode<Self::SignatureIdentity>>, Self::Error>

Chooses raw versus prehashed only after complete algorithm/key resolution.
Source§

fn compare_signature<W: Work>( &self, left: &Self::SignatureIdentity, right: &Self::SignatureIdentity, work: &W, ) -> Result<Ordering, Self::Error>

Semantic signature/default comparison for protected versus outer identifiers.
Source§

fn start_raw<W: Work>( &'a self, identity: &Self::SignatureIdentity, key: WorkingKey<'a>, signature: &'a Octets<'a>, work: &W, ) -> Result<Self::RawState, Self::Error>

Starts the raw challenge with the original signature and effective key.
Source§

fn update_raw<W: Work>( &self, state: &mut Self::RawState, bytes: &[u8], work: &W, ) -> Result<(), Self::Error>

Admits and processes original raw message chunks, never digest bytes.
Source§

fn finish_raw<W: Work>( &self, state: Self::RawState, work: &W, ) -> Result<SignatureAnswer, Self::Error>

Completes a raw signature only after successful complete source EOF.
Source§

fn verify_prehashed<W: Work>( &'a self, identity: &Self::SignatureIdentity, key: WorkingKey<'a>, signature: &Octets<'a>, digest: Prehash<'_, '_, Self, Self::Identity>, work: &W, ) -> Result<SignatureAnswer, Self::Error>

Verifies one borrowed finalized digest with its full identity; no rehash.

Auto Trait Implementations§

§

impl<P> Freeze for ProviderSession<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for ProviderSession<P>
where P: RefUnwindSafe,

§

impl<P> Send for ProviderSession<P>
where P: Send,

§

impl<P> Sync for ProviderSession<P>
where P: Sync,

§

impl<P> Unpin for ProviderSession<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for ProviderSession<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for ProviderSession<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.