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> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.