#[non_exhaustive]pub enum ContentCommitment {
Body(Hash),
Pack {
id: Hash,
len: u64,
},
Part(PartCommitment),
}Expand description
A parsed auth v2 content commitment (SPEC-TRANSPORT-CONNECT §7.1, §7.6).
ContentCommitment::parse accepts only the canonical text form, and
Display writes it back, so
parse(&c.to_string()) == Ok(c).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Body(Hash)
body:<64 hex>: BLAKE3 of the exact unary request bytes.
Pack
pack:<64 hex>:<decimal len>: an UploadPack stream.
Part(PartCommitment)
part:<64 hex ticket>:<decimal index>:<64 hex subtree>:<decimal len>:
one UploadPart stream (SPEC-TRANSPORT-CONNECT §7.6).
Implementations§
Source§impl ContentCommitment
impl ContentCommitment
Sourcepub fn parse(text: &str) -> Result<Self, AuthError>
pub fn parse(text: &str) -> Result<Self, AuthError>
Strict canonical parse: lowercase fixed-length hex; canonical decimals
(no sign, no leading zero, 0 allowed for a part: index); a part:
length of at least 1; an index that fits u32; exactly four fields
after part:.
§Errors
invalid body commitment, invalid pack commitment,
invalid part commitment or unknown content commitment.
Sourcepub fn kind(&self) -> CommitmentKind
pub fn kind(&self) -> CommitmentKind
The commitment’s kind.
Trait Implementations§
Source§impl Clone for ContentCommitment
impl Clone for ContentCommitment
impl Copy for ContentCommitment
Source§impl Debug for ContentCommitment
impl Debug for ContentCommitment
Source§impl Display for ContentCommitment
impl Display for ContentCommitment
impl Eq for ContentCommitment
Source§impl PartialEq for ContentCommitment
impl PartialEq for ContentCommitment
impl StructuralPartialEq for ContentCommitment
Auto Trait Implementations§
impl Freeze for ContentCommitment
impl RefUnwindSafe for ContentCommitment
impl Send for ContentCommitment
impl Sync for ContentCommitment
impl Unpin for ContentCommitment
impl UnsafeUnpin for ContentCommitment
impl UnwindSafe for ContentCommitment
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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