pub struct CommitEnvelope { /* private fields */ }Expand description
An immutable signed commit blob.
Implementations§
Source§impl CommitEnvelope
impl CommitEnvelope
Sourcepub fn new(
header: CommitHeader,
ciphertext: Vec<u8>,
signature: CommitSignature,
) -> Result<CommitEnvelope, CommitCodecError>
pub fn new( header: CommitHeader, ciphertext: Vec<u8>, signature: CommitSignature, ) -> Result<CommitEnvelope, CommitCodecError>
Constructs a bounded commit envelope.
Sourcepub const fn header(&self) -> &CommitHeader
pub const fn header(&self) -> &CommitHeader
Returns the authenticated public header.
Sourcepub fn ciphertext(&self) -> &[u8] ⓘ
pub fn ciphertext(&self) -> &[u8] ⓘ
Returns the encrypted commit body and AEAD tag.
Sourcepub const fn signature(&self) -> CommitSignature
pub const fn signature(&self) -> CommitSignature
Returns the author signature.
Sourcepub fn signing_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_bytes(&self) -> Vec<u8> ⓘ
Returns the exact canonical bytes covered by the signature.
Sourcepub fn signing_bytes_for(
header: &CommitHeader,
ciphertext: &[u8],
) -> Result<Vec<u8>, CommitCodecError>
pub fn signing_bytes_for( header: &CommitHeader, ciphertext: &[u8], ) -> Result<Vec<u8>, CommitCodecError>
Encodes a prospective header and ciphertext for signing.
Sourcepub fn encode_canonical(&self) -> Vec<u8> ⓘ
pub fn encode_canonical(&self) -> Vec<u8> ⓘ
Encodes the complete durable commit blob.
Sourcepub fn decode_canonical(
bytes: &[u8],
) -> Result<CommitEnvelope, CommitCodecError>
pub fn decode_canonical( bytes: &[u8], ) -> Result<CommitEnvelope, CommitCodecError>
Strictly decodes the unique durable commit representation.
Trait Implementations§
Source§impl Clone for CommitEnvelope
impl Clone for CommitEnvelope
Source§fn clone(&self) -> CommitEnvelope
fn clone(&self) -> CommitEnvelope
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 CommitEnvelope
impl Debug for CommitEnvelope
Source§impl PartialEq for CommitEnvelope
impl PartialEq for CommitEnvelope
impl Eq for CommitEnvelope
impl StructuralPartialEq for CommitEnvelope
Auto Trait Implementations§
impl Freeze for CommitEnvelope
impl RefUnwindSafe for CommitEnvelope
impl Send for CommitEnvelope
impl Sync for CommitEnvelope
impl Unpin for CommitEnvelope
impl UnwindSafe for CommitEnvelope
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.§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