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>,
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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