pub enum SparseWireError {
Truncated,
BadMagic,
UnsupportedVersion(u8),
LengthOutOfBounds,
TooManyLeaves,
TooLarge,
InvalidEntryMode(u8),
InvalidEntryName,
}Expand description
Errors raised when encoding or decoding a SparseResponse on the
wire. Kept tight — the transport layer wraps these in its own
transport-error type at the call site.
Variants§
Truncated
Buffer was shorter than the fixed-size manifest header (or truncated partway through a length-prefixed section). The decoder refuses to allocate from a truncated header.
BadMagic
First 4 bytes are not b"MSP1". Either the body is for a
different endpoint or the server is on a fork.
UnsupportedVersion(u8)
Version byte is something other than SPARSE_WIRE_VERSION.
A future server speaking v2 must not be silently downgraded.
LengthOutOfBounds
One of the length-prefixed sections claims more bytes than remain in the input. Likely a malicious server trying to make us allocate.
TooManyLeaves
leaf_count exceeds MAX_LEAVES. The verifier MUST refuse
before allocating anything proportional to the claimed count.
TooLarge
Encoded buffer would exceed SPARSE_WIRE_MAX_BYTES.
InvalidEntryMode(u8)
A tree entry’s mode byte is not a valid EntryMode.
InvalidEntryName
Entry name length declared as zero or > 255 bytes — outside the SPEC-OBJECTS §4 range. Matches the per-tree-entry name cap.
Trait Implementations§
Source§impl Clone for SparseWireError
impl Clone for SparseWireError
Source§fn clone(&self) -> SparseWireError
fn clone(&self) -> SparseWireError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparseWireError
impl Debug for SparseWireError
Source§impl Display for SparseWireError
impl Display for SparseWireError
impl Eq for SparseWireError
Source§impl Error for SparseWireError
impl Error for SparseWireError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for SparseWireError
impl PartialEq for SparseWireError
Source§fn eq(&self, other: &SparseWireError) -> bool
fn eq(&self, other: &SparseWireError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SparseWireError
Auto Trait Implementations§
impl Freeze for SparseWireError
impl RefUnwindSafe for SparseWireError
impl Send for SparseWireError
impl Sync for SparseWireError
impl Unpin for SparseWireError
impl UnsafeUnpin for SparseWireError
impl UnwindSafe for SparseWireError
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§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