pub enum SackError {
Truncated,
TooManyRanges,
Malformed,
}Available on crate feature
std only.Expand description
Errors returned by Sack::from_wire.
Variants§
Truncated
The buffer is shorter than the structure it declares.
TooManyRanges
range_count exceeds MAX_SACK_RANGES. Checked before any
allocation so an adversarial count cannot trigger OOM.
Malformed
The encoding is structurally invalid: range_count == 0, gap == 0
(adjacent ranges), a gap/len pair would underflow the sequence space,
or ranges are not strictly descending and non-adjacent.
Trait Implementations§
impl Copy for SackError
impl Eq for SackError
Source§impl Error for SackError
impl Error for SackError
1.30.0 · 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 StructuralPartialEq for SackError
Auto Trait Implementations§
impl Freeze for SackError
impl RefUnwindSafe for SackError
impl Send for SackError
impl Sync for SackError
impl Unpin for SackError
impl UnsafeUnpin for SackError
impl UnwindSafe for SackError
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