pub enum BencodeError {
NegativeLen(String),
Unexpected(String),
Utf8Error(String),
}
Expand description
Custom error types returned during parsing
Variants§
NegativeLen(String)
Returned when the number specifying the length of a string is negative - b“-3:dog“. Includes the position in the vector at which the error occured.
Unexpected(String)
Returned when an unexpected byte was found at the current position during parsing - missing ‘e’ at the end of list. Includes the position in the vector at which the error occured.
Utf8Error(String)
Returned when the parsed bytes are not UTF-8. Includes the position in the vector at which the error occured.
Trait Implementations§
Source§impl Debug for BencodeError
impl Debug for BencodeError
Source§impl Display for BencodeError
impl Display for BencodeError
Source§impl Error for BencodeError
impl Error for BencodeError
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()
Source§impl PartialEq for BencodeError
impl PartialEq for BencodeError
impl Eq for BencodeError
impl StructuralPartialEq for BencodeError
Auto Trait Implementations§
impl Freeze for BencodeError
impl RefUnwindSafe for BencodeError
impl Send for BencodeError
impl Sync for BencodeError
impl Unpin for BencodeError
impl UnwindSafe for BencodeError
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