pub enum SegbError {
Io(Error),
BadMagic {
found: String,
},
TruncatedHeader {
need: usize,
got: usize,
},
TruncatedRecordHeader {
offset: u64,
need: usize,
got: usize,
},
TruncatedPayload {
offset: u64,
need: usize,
got: usize,
},
InvalidLength {
offset: u64,
length: i32,
},
InvalidEntryCount {
count: i32,
},
TrailerOverflow {
trailer_bytes: u64,
stream_bytes: u64,
},
UnknownState(i32),
InvalidSeek(String),
MalformedVarint {
offset: usize,
},
ProtobufOverflow {
offset: usize,
length: usize,
remaining: usize,
},
}Expand description
All errors that the SEGB reader can produce.
Variants§
Io(Error)
The file / stream produced an I/O error.
BadMagic
The magic bytes at the expected position do not match SEGB.
TruncatedHeader
The file header is shorter than expected.
TruncatedRecordHeader
A record header is shorter than expected.
TruncatedPayload
A record payload is shorter than the length field claims.
InvalidLength
A record_length value is negative, which is not valid.
InvalidEntryCount
entries_count in a SEGB v2 header is negative.
TrailerOverflow
The trailer size overflows the file size in SEGB v2.
UnknownState(i32)
An EntryState byte did not map to a known variant.
InvalidSeek(String)
A seek operation was asked to go to a negative or overflow position.
MalformedVarint
A protobuf varint was longer than 10 bytes (malformed).
ProtobufOverflow
A protobuf length-delimited field extends past the buffer end.
Trait Implementations§
Source§impl Error for SegbError
impl Error for SegbError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for SegbError
impl !UnwindSafe for SegbError
impl Freeze for SegbError
impl Send for SegbError
impl Sync for SegbError
impl Unpin for SegbError
impl UnsafeUnpin for SegbError
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