pub enum DecodeError {
NotFound,
ParentNotFound(TreeNode),
LeafNotFound(ChunkNum),
ParentHashMismatch(TreeNode),
LeafHashMismatch(ChunkNum),
Read(ReadError),
Io(Error),
}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 quinn::RecvStream, so read errors will be
propagated as DecodeError::Read, containing a quinn::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::Io variant is just a fallback for any other io error that
is not actually a quinn::ReadError.
Variants§
NotFound
A chunk was not found or invalid, so the provider stopped sending data
ParentNotFound(TreeNode)
A parent was not found or invalid, so the provider stopped sending data
LeafNotFound(ChunkNum)
A parent was not found or invalid, so the provider stopped sending data
ParentHashMismatch(TreeNode)
The hash of a parent did not match the expected hash
LeafHashMismatch(ChunkNum)
The hash of a leaf did not match the expected hash
Read(ReadError)
Error when reading from the stream
Io(Error)
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
use the Display impl or to_string()