#[non_exhaustive]pub enum DecodeError {
ChunkNotFound {
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
ParentNotFound {
node: TreeNode,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
LeafNotFound {
num: ChunkNum,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
ParentHashMismatch {
node: TreeNode,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
LeafHashMismatch {
num: ChunkNum,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
Read {
source: ReadError,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
DecodeIo {
source: Error,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
}
Expand description
Decode error that you can get once you have sent the request and are
decoding the response, e.g. from AtBlobContent::next
.
This is similar to bao_tree::io::DecodeError
, but takes into account
that we are reading from a RecvStream
, so read errors will be
propagated as DecodeError::Read
, containing a ReadError
.
This carries more concrete information about the error than an io::Error
.
When the provider finds that it does not have a chunk that we requested,
or that the chunk is invalid, it will stop sending data without producing
an error. This is indicated by either the DecodeError::ParentNotFound
or
DecodeError::LeafNotFound
variant, which can be used to detect that data
is missing but the connection as well that the provider is otherwise healthy.
The DecodeError::ParentHashMismatch
and DecodeError::LeafHashMismatch
variants indicate that the provider has sent us invalid data. A well-behaved
provider should never do this, so this is an indication that the provider is
not behaving correctly.
The DecodeError::DecodeIo
variant is just a fallback for any other io error that
is not actually a DecodeError::Read
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ChunkNotFound
A chunk was not found or invalid, so the provider stopped sending data
ParentNotFound
A parent was not found or invalid, so the provider stopped sending data
LeafNotFound
A parent was not found or invalid, so the provider stopped sending data
ParentHashMismatch
The hash of a parent did not match the expected hash
LeafHashMismatch
The hash of a leaf did not match the expected hash
Read
Error when reading from the stream
DecodeIo
A generic io error
Trait Implementations§
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
Source§impl ErrorCompat for DecodeError
impl ErrorCompat for DecodeError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source
. Read moreSource§impl From<AtBlobHeaderNextError> for DecodeError
impl From<AtBlobHeaderNextError> for DecodeError
Source§fn from(cause: AtBlobHeaderNextError) -> Self
fn from(cause: AtBlobHeaderNextError) -> Self
Source§impl From<DecodeError> for DecodeError
impl From<DecodeError> for DecodeError
Source§fn from(value: DecodeError) -> Self
fn from(value: DecodeError) -> Self
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(cause: DecodeError) -> Self
fn from(cause: DecodeError) -> Self
Source§impl From<DecodeError> for GetError
impl From<DecodeError> for GetError
Source§fn from(value: DecodeError) -> Self
fn from(value: DecodeError) -> Self
Auto Trait Implementations§
impl !Freeze for DecodeError
impl !RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl !UnwindSafe for DecodeError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
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> 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<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
Source§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
Source§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.