pub enum Error {
NotSourcePiece {
piece_index: PieceIndex,
piece_offset: u32,
},
PieceOffsetTooLarge {
piece_index: PieceIndex,
piece_offset: u32,
},
NoSegmentItem {
progress: usize,
offset_in_segment: usize,
segment_index: SegmentIndex,
piece_index: PieceIndex,
piece_offset: u32,
},
UnexpectedFirstSegmentItem {
segment_progress: usize,
offset_in_segment: usize,
segment_index: SegmentIndex,
segment_item: Box<SegmentItem>,
piece_index: PieceIndex,
piece_offset: u32,
},
UnexpectedContinuingSegmentItem {
collected_data: usize,
segment_index: SegmentIndex,
segment_item: Box<SegmentItem>,
piece_index: PieceIndex,
piece_offset: u32,
},
TooManySegments {
first_segment_index: SegmentIndex,
last_segment_index: SegmentIndex,
piece_index: PieceIndex,
piece_offset: u32,
},
ObjectTooLarge {
data_length: usize,
max_object_len: usize,
piece_index: PieceIndex,
piece_offset: u32,
},
LengthPrefixTooLarge {
length_prefix_len: usize,
max_object_len: usize,
piece_index: PieceIndex,
piece_offset: u32,
},
ObjectDecoding {
source: Error,
},
SegmentGetter {
source: SegmentGetterError,
},
PieceGetterError {
source: BoxError,
},
PieceNotFound {
piece_index: PieceIndex,
},
}
Expand description
Object fetching errors.
Variants§
NotSourcePiece
Supplied piece index is not a source piece
PieceOffsetTooLarge
Supplied piece offset is too large
NoSegmentItem
No item in segment at offset
UnexpectedFirstSegmentItem
Unexpected item in first segment at offset
UnexpectedContinuingSegmentItem
Unexpected item in continuing segment at offset
TooManySegments
Object not found after downloading expected number of segments
ObjectTooLarge
Object is too large error
LengthPrefixTooLarge
Length prefix is too large error
ObjectDecoding
Object decoding error
Fields
§
source: Error
SegmentGetter
Segment getter error
Fields
§
source: SegmentGetterError
PieceGetterError
Piece getter error
PieceNotFound
Piece getter couldn’t find the piece
Fields
§
piece_index: PieceIndex
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()
source§impl From<SegmentGetterError> for Error
impl From<SegmentGetterError> for Error
source§fn from(source: SegmentGetterError) -> Self
fn from(source: SegmentGetterError) -> Self
Converts to this type from the input type.
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