pub struct TranscriptWriter<'a, B: BufMut> { /* private fields */ }Expand description
Writes data to a transcript buffer, tracking proof size via tracing events.
Transcript buffers are always growable (BytesMut or equivalent), so serialization
writes are infallible in practice. The write methods use expect rather than returning
Result because the underlying buffers dynamically resize and cannot run out of space.
Implementations§
Source§impl<B: BufMut> TranscriptWriter<'_, B>
impl<B: BufMut> TranscriptWriter<'_, B>
pub const fn buffer(&mut self) -> &mut B
Sourcepub fn write<T: SerializeBytes>(&mut self, value: &T)
pub fn write<T: SerializeBytes>(&mut self, value: &T)
Serializes and writes a value to the transcript buffer.
§Panics
Panics if serialization fails. Transcript buffers are growable, so this cannot fail due to insufficient space.
Sourcepub fn write_slice<T: SerializeBytes>(&mut self, values: &[T])
pub fn write_slice<T: SerializeBytes>(&mut self, values: &[T])
Serializes and writes a slice of values to the transcript buffer.
§Panics
Panics if serialization fails. Transcript buffers are growable, so this cannot fail due to insufficient space.
pub fn write_bytes(&mut self, data: &[u8])
pub fn write_scalar<F: Field>(&mut self, f: F)
Sourcepub fn write_scalar_iter<F: Field>(&mut self, it: impl IntoIterator<Item = F>)
pub fn write_scalar_iter<F: Field>(&mut self, it: impl IntoIterator<Item = F>)
Serializes and writes an iterator of field elements to the transcript buffer.
§Panics
Panics if serialization fails. Transcript buffers are growable, so this cannot fail due to insufficient space.
pub fn write_scalar_slice<F: Field>(&mut self, elems: &[F])
pub fn write_debug(&mut self, msg: &str)
Auto Trait Implementations§
impl<'a, B> !UnwindSafe for TranscriptWriter<'a, B>
impl<'a, B> Freeze for TranscriptWriter<'a, B>
impl<'a, B> RefUnwindSafe for TranscriptWriter<'a, B>where
B: RefUnwindSafe,
impl<'a, B> Send for TranscriptWriter<'a, B>where
B: Send,
impl<'a, B> Sync for TranscriptWriter<'a, B>where
B: Sync,
impl<'a, B> Unpin for TranscriptWriter<'a, B>
impl<'a, B> UnsafeUnpin for TranscriptWriter<'a, B>
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
§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>
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>
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