pub struct PartialTranscript { /* private fields */ }
Expand description
A partial transcript.
A partial transcript is a transcript which may not have all the data authenticated.
Implementations§
Source§impl PartialTranscript
impl PartialTranscript
Sourcepub fn new(sent_len: usize, received_len: usize) -> Self
pub fn new(sent_len: usize, received_len: usize) -> Self
Creates a new partial transcript initalized to all 0s.
§Arguments
sent_len
- The length of the sent data.received_len
- The length of the received data.
Sourcepub fn len_received(&self) -> usize
pub fn len_received(&self) -> usize
Returns the length of the received transcript.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns whether the transcript is complete.
Sourcepub fn contains(&self, direction: Direction, idx: &Idx) -> bool
pub fn contains(&self, direction: Direction, idx: &Idx) -> bool
Returns whether the index is in bounds of the transcript.
Sourcepub fn sent_unsafe(&self) -> &[u8] ⓘ
pub fn sent_unsafe(&self) -> &[u8] ⓘ
Returns a reference to the sent data.
§Warning
Not all of the data in the transcript may have been authenticated. See sent_authed for a set of ranges which have been.
Sourcepub fn received_unsafe(&self) -> &[u8] ⓘ
pub fn received_unsafe(&self) -> &[u8] ⓘ
Returns a reference to the received data.
§Warning
Not all of the data in the transcript may have been authenticated. See received_authed for a set of ranges which have been.
Sourcepub fn sent_authed(&self) -> &Idx
pub fn sent_authed(&self) -> &Idx
Returns the index of sent data which have been authenticated.
Sourcepub fn received_authed(&self) -> &Idx
pub fn received_authed(&self) -> &Idx
Returns the index of received data which have been authenticated.
Sourcepub fn sent_unauthed(&self) -> Idx
pub fn sent_unauthed(&self) -> Idx
Returns the index of sent data which haven’t been authenticated.
Sourcepub fn received_unauthed(&self) -> Idx
pub fn received_unauthed(&self) -> Idx
Returns the index of received data which haven’t been authenticated.
Sourcepub fn iter(&self, direction: Direction) -> impl Iterator<Item = u8> + '_
pub fn iter(&self, direction: Direction) -> impl Iterator<Item = u8> + '_
Returns an iterator over the authenticated data in the transcript.
Sourcepub fn union_transcript(&mut self, other: &PartialTranscript)
pub fn union_transcript(&mut self, other: &PartialTranscript)
Unions the authenticated data of this transcript with another.
§Panics
Panics if the other transcript is not the same length.
Sourcepub fn union_subsequence(&mut self, direction: Direction, seq: &Subsequence)
pub fn union_subsequence(&mut self, direction: Direction, seq: &Subsequence)
Unions an authenticated subsequence into this transcript.
§Panics
Panics if the subsequence is outside the bounds of the transcript.
Sourcepub fn set_unauthed(&mut self, value: u8)
pub fn set_unauthed(&mut self, value: u8)
Sets all bytes in the transcript which haven’t been authenticated.
§Arguments
value
- The value to set the unauthenticated bytes to
Trait Implementations§
Source§impl Clone for PartialTranscript
impl Clone for PartialTranscript
Source§fn clone(&self) -> PartialTranscript
fn clone(&self) -> PartialTranscript
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PartialTranscript
impl Debug for PartialTranscript
Source§impl<'de> Deserialize<'de> for PartialTranscript
impl<'de> Deserialize<'de> for PartialTranscript
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CompressedPartialTranscript> for PartialTranscript
impl From<CompressedPartialTranscript> for PartialTranscript
Source§fn from(compressed: CompressedPartialTranscript) -> Self
fn from(compressed: CompressedPartialTranscript) -> Self
Source§impl From<PartialTranscript> for CompressedPartialTranscript
impl From<PartialTranscript> for CompressedPartialTranscript
Source§fn from(uncompressed: PartialTranscript) -> Self
fn from(uncompressed: PartialTranscript) -> Self
Auto Trait Implementations§
impl Freeze for PartialTranscript
impl RefUnwindSafe for PartialTranscript
impl Send for PartialTranscript
impl Sync for PartialTranscript
impl Unpin for PartialTranscript
impl UnwindSafe for PartialTranscript
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> HashCommit for Twhere
T: Serialize,
impl<T> HashCommit for Twhere
T: Serialize,
§fn hash_commit(self) -> (Decommitment<Self>, Hash)
fn hash_commit(self) -> (Decommitment<Self>, Hash)
§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