pub enum Error {
Show 14 variants
NotSourcePiece {
mapping: GlobalObject,
},
PieceOffsetTooLarge {
mapping: GlobalObject,
},
ObjectTooLarge {
data_length: usize,
max_object_len: usize,
mapping: GlobalObject,
},
LengthPrefixTooLarge {
length_prefix_len: usize,
max_object_len: usize,
mapping: GlobalObject,
},
InvalidDataHash {
data_hash: Blake3Hash,
data_length: usize,
mapping: GlobalObject,
},
PieceGetterError {
error: String,
mapping: GlobalObject,
},
PieceNotFound {
piece_index: PieceIndex,
},
PieceOffsetInSegmentHeader {
mapping: GlobalObject,
},
SegmentDecoding {
source: Error,
segment_index: SegmentIndex,
mapping: GlobalObject,
},
UnknownSegmentVariant {
segment_variant: u8,
segment_index: SegmentIndex,
mapping: GlobalObject,
},
UnexpectedSegmentItem {
segment_progress: usize,
segment_index: SegmentIndex,
segment_item: Box<SegmentItem>,
mapping: GlobalObject,
},
UnexpectedSegmentItemVariant {
segment_progress: usize,
segment_index: SegmentIndex,
segment_item_variant: u8,
segment_item_lengths: Option<(usize, usize)>,
mapping: GlobalObject,
},
InvalidObject {
next_source_piece_index: PieceIndex,
segment_data_length: Option<usize>,
mapping: GlobalObject,
},
InvalidMapping {
next_source_piece_index: PieceIndex,
remaining_piece_count: usize,
object_data_length: usize,
mapping: GlobalObject,
},
}
Expand description
Object fetching errors.
Variants§
NotSourcePiece
Supplied piece index is not a source piece
Fields
§
mapping: GlobalObject
PieceOffsetTooLarge
Supplied piece offset is too large
Fields
§
mapping: GlobalObject
ObjectTooLarge
Object is too large error
LengthPrefixTooLarge
Length prefix is too large error
InvalidDataHash
Hash doesn’t match data
PieceGetterError
Piece getter error
Fields
§
error: String
The original anyhow::Error
, debug-printed as a string.
This allows us to check errors for equality in tests.
§
mapping: GlobalObject
PieceNotFound
Piece getter couldn’t find the piece
Fields
§
piece_index: PieceIndex
PieceOffsetInSegmentHeader
Supplied piece offset is inside the minimum segment header size
Fields
§
mapping: GlobalObject
SegmentDecoding
Segment decoding error
UnknownSegmentVariant
Unknown segment variant error
UnexpectedSegmentItem
Unexpected segment item error
UnexpectedSegmentItemVariant
Unexpected segment item variant error
InvalidObject
Object length couldn’t be decoded after downloading two pieces
Fields
§
next_source_piece_index: PieceIndex
The next source piece index after the first two pieces
§
mapping: GlobalObject
InvalidMapping
Object extends beyond block continuation, or the mapping is otherwise invalid
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Mutably borrows from an owned value. Read more
§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>
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>
Converts
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>
Converts
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