pub struct ParserSourceIdentity { /* private fields */ }Expand description
Authenticated identity of one exact raw-source frame.
Implementations§
Source§impl ParserSourceIdentity
impl ParserSourceIdentity
Sourcepub fn for_bytes(source: &[u8]) -> Result<Self, ParserProtocolError>
pub fn for_bytes(source: &[u8]) -> Result<Self, ParserProtocolError>
Authenticate one bounded raw-source payload.
§Errors
Returns an error when the source exceeds the hard byte ceiling.
Sourcepub fn new(
byte_len: u32,
blake3: ParserContentDigest,
) -> Result<Self, ParserProtocolError>
pub fn new( byte_len: u32, blake3: ParserContentDigest, ) -> Result<Self, ParserProtocolError>
Construct a bounded source identity from authenticated metadata.
§Errors
Returns an error when byte_len exceeds the hard source ceiling.
Sourcepub fn validate_bytes(&self, source: &[u8]) -> Result<(), ParserProtocolError>
pub fn validate_bytes(&self, source: &[u8]) -> Result<(), ParserProtocolError>
Validate exact source bytes against both authenticated length and digest.
§Errors
Returns an error for a length or BLAKE3 mismatch.
Sourcepub const fn blake3(&self) -> &ParserContentDigest
pub const fn blake3(&self) -> &ParserContentDigest
Borrow the authenticated source digest.
Trait Implementations§
Source§impl Clone for ParserSourceIdentity
impl Clone for ParserSourceIdentity
Source§fn clone(&self) -> ParserSourceIdentity
fn clone(&self) -> ParserSourceIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParserSourceIdentity
impl Debug for ParserSourceIdentity
Source§impl<'de> Deserialize<'de> for ParserSourceIdentity
impl<'de> Deserialize<'de> for ParserSourceIdentity
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ParserSourceIdentity
impl PartialEq for ParserSourceIdentity
Source§impl Serialize for ParserSourceIdentity
impl Serialize for ParserSourceIdentity
impl Eq for ParserSourceIdentity
impl StructuralPartialEq for ParserSourceIdentity
Auto Trait Implementations§
impl Freeze for ParserSourceIdentity
impl RefUnwindSafe for ParserSourceIdentity
impl Send for ParserSourceIdentity
impl Sync for ParserSourceIdentity
impl Unpin for ParserSourceIdentity
impl UnwindSafe for ParserSourceIdentity
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.