pub struct TranscriptCommitConfigBuilder<'a> { /* private fields */ }
Expand description
A builder for TranscriptCommitConfig
.
The default hash algorithm is HashAlgId::BLAKE3
and the default kind
is TranscriptCommitmentKind::Encoding
.
Implementations§
source§impl<'a> TranscriptCommitConfigBuilder<'a>
impl<'a> TranscriptCommitConfigBuilder<'a>
sourcepub fn new(transcript: &'a Transcript) -> Self
pub fn new(transcript: &'a Transcript) -> Self
Creates a new commit config builder.
sourcepub fn encoding_hash_alg(&mut self, alg: HashAlgId) -> &mut Self
pub fn encoding_hash_alg(&mut self, alg: HashAlgId) -> &mut Self
Sets the hash algorithm to use for encoding commitments.
sourcepub fn default_kind(
&mut self,
default_kind: TranscriptCommitmentKind,
) -> &mut Self
pub fn default_kind( &mut self, default_kind: TranscriptCommitmentKind, ) -> &mut Self
Sets the default kind of commitment to use.
sourcepub fn commit_with_kind(
&mut self,
ranges: &dyn ToRangeSet<usize>,
direction: Direction,
kind: TranscriptCommitmentKind,
) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
pub fn commit_with_kind( &mut self, ranges: &dyn ToRangeSet<usize>, direction: Direction, kind: TranscriptCommitmentKind, ) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
Adds a commitment.
§Arguments
ranges
- The ranges of the commitment.direction
- The direction of the transcript.kind
- The kind of commitment.
sourcepub fn commit(
&mut self,
ranges: &dyn ToRangeSet<usize>,
direction: Direction,
) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
pub fn commit( &mut self, ranges: &dyn ToRangeSet<usize>, direction: Direction, ) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
Adds a commitment with the default kind.
§Arguments
ranges
- The ranges of the commitment.direction
- The direction of the transcript.
sourcepub fn commit_sent(
&mut self,
ranges: &dyn ToRangeSet<usize>,
) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
pub fn commit_sent( &mut self, ranges: &dyn ToRangeSet<usize>, ) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
Adds a commitment with the default kind to the sent data transcript.
§Arguments
ranges
- The ranges of the commitment.
sourcepub fn commit_recv(
&mut self,
ranges: &dyn ToRangeSet<usize>,
) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
pub fn commit_recv( &mut self, ranges: &dyn ToRangeSet<usize>, ) -> Result<&mut Self, TranscriptCommitConfigBuilderError>
Adds a commitment with the default kind to the received data transcript.
§Arguments
ranges
- The ranges of the commitment.
sourcepub fn build(
self,
) -> Result<TranscriptCommitConfig, TranscriptCommitConfigBuilderError>
pub fn build( self, ) -> Result<TranscriptCommitConfig, TranscriptCommitConfigBuilderError>
Builds the configuration.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TranscriptCommitConfigBuilder<'a>
impl<'a> RefUnwindSafe for TranscriptCommitConfigBuilder<'a>
impl<'a> Send for TranscriptCommitConfigBuilder<'a>
impl<'a> Sync for TranscriptCommitConfigBuilder<'a>
impl<'a> Unpin for TranscriptCommitConfigBuilder<'a>
impl<'a> UnwindSafe for TranscriptCommitConfigBuilder<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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