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>
impl<'context, 'reader, 'document, P: AsnDigest<'document>, E> ImprintState<'context, 'reader, 'document, P, E>
Sourcepub fn write(&mut self, bytes: &[u8]) -> Result<(), Refused>
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.
Sourcepub fn write_from(
&mut self,
bytes: &[u8],
origin: &Reader<'_>,
) -> Result<(), Refused>
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.
Sourcepub fn finish(
self,
) -> Result<ImprintDigest<'context, 'reader, 'document, P, E>, Refused>
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.