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>
impl<P> ProviderSession<P>
Sourcepub const fn new(backend: P) -> Self
pub const fn new(backend: P) -> Self
Creates a distinct selection owner before resolving any document input.
Sourcepub const fn backend(&self) -> &P
pub const fn backend(&self) -> &P
The selected adapter; this accessor does not transfer session provenance.
Sourcepub fn same_session(&self, other: &Self) -> bool
pub fn same_session(&self, other: &Self) -> bool
Identity of the live selection owner, even when both adapters are ZSTs.
Trait Implementations§
Source§impl<'a, P: AsnDigest<'a>> AsnDigest<'a> for ProviderSession<P>
impl<'a, P: AsnDigest<'a>> AsnDigest<'a> for ProviderSession<P>
Source§impl<P: Debug> Debug for ProviderSession<P>
impl<P: Debug> Debug for ProviderSession<P>
Source§impl<P> Deref for ProviderSession<P>
impl<P> Deref for ProviderSession<P>
Source§impl<'a, P: Digest<'a>> Digest<'a> for ProviderSession<P>
impl<'a, P: Digest<'a>> Digest<'a> for ProviderSession<P>
Source§type State = <P as Digest<'a>>::State
type State = <P as Digest<'a>>::State
Digest state, independently movable from its identity object.
Source§type Output = <P as Digest<'a>>::Output
type Output = <P as Digest<'a>>::Output
Final output, inline or retaining its own admitted allocation charge.
Source§type Error = <P as Digest<'a>>::Error
type Error = <P as Digest<'a>>::Error
Original callback failure, including that provider’s resource refusal.
Source§fn width(&self, identity: &Self::Identity) -> Option<usize>
fn width(&self, identity: &Self::Identity) -> Option<usize>
Fixed output width, or
None for an identity without one. This is O(1)
metadata access on the resolved identity, not parsing.Source§fn compare<W: Work>(
&self,
left: &Self::Identity,
right: &Self::Identity,
work: &W,
) -> Result<Ordering, Self::Error>
fn compare<W: Work>( &self, left: &Self::Identity, right: &Self::Identity, work: &W, ) -> Result<Ordering, Self::Error>
Total semantic order:
Equal means the outputs can be shared.Source§fn start<W: Work>(
&'a self,
identity: &Self::Identity,
work: &W,
) -> Result<Resolution<Self::State>, Self::Error>
fn start<W: Work>( &'a self, identity: &Self::Identity, work: &W, ) -> Result<Resolution<Self::State>, Self::Error>
Starts one stream for this identity without retaining a reference to the
identity object. A backend without incremental capability answers
Unsupported; it never buffers into a one-shot fallback.Source§fn update<W: Work>(
&self,
state: &mut Self::State,
bytes: &[u8],
work: &W,
) -> Result<(), Self::Error>
fn update<W: Work>( &self, state: &mut Self::State, bytes: &[u8], work: &W, ) -> Result<(), Self::Error>
Admits and processes one complete chunk exactly once.
Source§impl<'a, P: SignatureProvider<'a>> SignatureProvider<'a> for ProviderSession<P>
impl<'a, P: SignatureProvider<'a>> SignatureProvider<'a> for ProviderSession<P>
Source§type SignatureIdentity = <P as SignatureProvider<'a>>::SignatureIdentity
type SignatureIdentity = <P as SignatureProvider<'a>>::SignatureIdentity
Fully resolved signature identity, including algorithm-specific defaults.
Source§type RawState = <P as SignatureProvider<'a>>::RawState
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>
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>
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>
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>
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>
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>
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> 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