#[non_exhaustive]pub enum DecodeError {
ChunkNotFound {
meta: Meta,
},
ParentNotFound {
node: TreeNode,
meta: Meta,
},
LeafNotFound {
num: ChunkNum,
meta: Meta,
},
ParentHashMismatch {
node: TreeNode,
meta: Meta,
},
LeafHashMismatch {
num: ChunkNum,
meta: Meta,
},
Read {
source: Error,
meta: Meta,
},
Write {
source: Error,
meta: Meta,
},
}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 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.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ChunkNotFound
A chunk was not found or invalid, so the provider stopped sending data
Fields
meta: MetaCaptured call-site metadata
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
Write
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 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
Source§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 AnyError
impl From<DecodeError> for AnyError
Source§fn from(value: DecodeError) -> AnyError
fn from(value: DecodeError) -> AnyError
Source§impl From<DecodeError> for DecodeError
impl From<DecodeError> for DecodeError
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(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Source§impl StackError for DecodeError
impl StackError for DecodeError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
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§
§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
§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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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>
§impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> StackErrorExt for Twhere
T: StackError + 'static,
impl<T> StackErrorExt for Twhere
T: StackError + 'static,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.