Enum bee_code::BencodeError
source · 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)>
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
source§fn eq(&self, other: &BencodeError) -> bool
fn eq(&self, other: &BencodeError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for BencodeError
impl StructuralPartialEq for BencodeError
Auto Trait Implementations§
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