pub struct InteractionPattern { /* private fields */ }Expand description
A complete, validated transcript described as a sequence of typed steps.
Implementations§
Source§impl InteractionPattern
impl InteractionPattern
Sourcepub fn new(interactions: Vec<Interaction>) -> Result<Self, TranscriptError>
pub fn new(interactions: Vec<Interaction>) -> Result<Self, TranscriptError>
Sourcepub fn interactions(&self) -> &[Interaction]
pub fn interactions(&self) -> &[Interaction]
Read-only access to the recorded sequence.
Sourcepub fn pattern_hash(&self) -> [u8; 32]
pub fn pattern_hash(&self) -> [u8; 32]
Stable 32-byte fingerprint of the pattern.
§Algorithm
- Render the pattern via alternate-mode
Display. - Feed the rendered bytes into Keccak-256.
The rendering is type-name-free and length-prefixed, so the digest is stable across compiler versions and free of label collision shenanigans.
§Performance
One allocation for the rendered string and one Keccak-256 call. Intended for use at protocol setup, not in hot paths.
Trait Implementations§
Source§impl Clone for InteractionPattern
impl Clone for InteractionPattern
Source§impl Debug for InteractionPattern
impl Debug for InteractionPattern
Source§impl Default for InteractionPattern
impl Default for InteractionPattern
Source§impl Display for InteractionPattern
impl Display for InteractionPattern
impl Eq for InteractionPattern
Source§impl Hash for InteractionPattern
impl Hash for InteractionPattern
Source§impl Ord for InteractionPattern
impl Ord for InteractionPattern
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for InteractionPattern
impl PartialEq for InteractionPattern
Source§impl PartialOrd for InteractionPattern
impl PartialOrd for InteractionPattern
impl StructuralPartialEq for InteractionPattern
Auto Trait Implementations§
impl Freeze for InteractionPattern
impl RefUnwindSafe for InteractionPattern
impl Send for InteractionPattern
impl Sync for InteractionPattern
impl Unpin for InteractionPattern
impl UnsafeUnpin for InteractionPattern
impl UnwindSafe for InteractionPattern
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more