Skip to main content

ImprintContext

Struct ImprintContext 

Source
pub struct ImprintContext<'reader, 'document, P: AsnDigest<'document>, E> { /* private fields */ }
Expand description

One original imprint, one provider identity and the current producing work.

The context is constructed only after schema/session/width preflight. Its non-zero-sized owner distinguishes even otherwise identical operations. All state transitions retain the first refusal; no RefCell borrow crosses a callback.

Implementations§

Source§

impl<'reader, 'document, P: AsnDigest<'document>, E> ImprintContext<'reader, 'document, P, E>

Source

pub fn reader(&self) -> &Reader<'document>

Original producing information reader and current operation ceilings.

Source

pub fn identity(&self) -> &P::Identity

Full selected-provider identity; output width is not an algorithm ID.

Source

pub fn start( &self, ) -> Result<ImprintState<'_, 'reader, 'document, P, E>, Refused>

Starts another candidate/intermediate hash under this SAME identity.

Source

pub fn stream<'context, S: Source<Error = E>>( &'context self, source: &mut S, states: &mut [&mut ImprintState<'context, 'reader, 'document, P, E>], ) -> Result<(), Refused>

Feeds every selected state in ONE complete source pass. Empty state lists and foreign contexts refuse before source I/O. Source errors and ignored receiver failures remain sticky across the whole recipe.

Source

pub fn stream_from<'context, S: Source<Error = E>>( &'context self, source: &mut S, origin: &Reader<'_>, states: &mut [&mut ImprintState<'context, 'reader, 'document, P, E>], ) -> Result<(), Refused>

Streams another original source using ITS producing ceiling and this operation’s current root ceilings/account. This does not use the old source’s former account or widen a narrowed current query. The format recipe supplies the actual source reader, never a replacement parser.

Source

pub fn compare<'context>( &'context self, digest: &ImprintDigest<'_, '_, 'document, P, E>, ) -> Result<ImprintProof<'context>, Refused>

Compares one completed output with the original declared hash. Other candidates can be completed and compared without another payload pass.

Auto Trait Implementations§

§

impl<'reader, 'document, P, E> !Freeze for ImprintContext<'reader, 'document, P, E>

§

impl<'reader, 'document, P, E> !RefUnwindSafe for ImprintContext<'reader, 'document, P, E>

§

impl<'reader, 'document, P, E> !Send for ImprintContext<'reader, 'document, P, E>

§

impl<'reader, 'document, P, E> !Sync for ImprintContext<'reader, 'document, P, E>

§

impl<'reader, 'document, P, E> !UnwindSafe for ImprintContext<'reader, 'document, P, E>

§

impl<'reader, 'document, P, E> Unpin for ImprintContext<'reader, 'document, P, E>
where &'document P: Unpin, <P as Digest<'document>>::Identity: Unpin, RefCell<Option<ImprintError<E, <P as Digest<'document>>::Error>>>: Unpin,

§

impl<'reader, 'document, P, E> UnsafeUnpin for ImprintContext<'reader, 'document, P, E>
where &'document P: UnsafeUnpin, <P as Digest<'document>>::Identity: UnsafeUnpin, RefCell<Option<ImprintError<E, <P as Digest<'document>>::Error>>>: UnsafeUnpin,

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<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.