Skip to main content

ImprintState

Struct ImprintState 

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

One unfinished state of this operation’s exact resolved identity. Dropping it unfinished prevents a successful computation, even if another alternative matched. Opaque provider state owns its admitted storage.

Implementations§

Source§

impl<'context, 'reader, 'document, P: AsnDigest<'document>, E> ImprintState<'context, 'reader, 'document, P, E>

Source

pub fn write(&mut self, bytes: &[u8]) -> Result<(), Refused>

Admits and hashes one original/generated chunk. An ignored failure cannot be repaired by subsequent writes or finalization.

Source

pub fn write_from( &mut self, bytes: &[u8], origin: &Reader<'_>, ) -> Result<(), Refused>

Hashes a range from another original reader, with that origin and the current operation admitted together. The caller’s format kernel binds bytes to that original source before invoking this operation.

Source

pub fn finish( self, ) -> Result<ImprintDigest<'context, 'reader, 'document, P, E>, Refused>

Consumes the state exactly once. A wrong provider output width refuses before exposing it for an intermediate tree or final comparison.

§Panics

If the internal ownership invariant is violated. The consuming public API retains its backend state until this single completion.

Trait Implementations§

Source§

impl<'document, P: AsnDigest<'document>, E> Drop for ImprintState<'_, '_, 'document, P, E>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'context, 'reader, 'document, P, E> Freeze for ImprintState<'context, 'reader, 'document, P, E>
where &'context ImprintContext<'reader, 'document, P, E>: Freeze, Option<<P as Digest<'document>>::State>: Freeze,

§

impl<'context, 'reader, 'document, P, E> Unpin for ImprintState<'context, 'reader, 'document, P, E>
where &'context ImprintContext<'reader, 'document, P, E>: Unpin, Option<<P as Digest<'document>>::State>: Unpin,

§

impl<'context, 'reader, 'document, P, E> UnsafeUnpin for ImprintState<'context, 'reader, 'document, P, E>
where &'context ImprintContext<'reader, 'document, P, E>: UnsafeUnpin, Option<<P as Digest<'document>>::State>: 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.