pub struct BitsError { /* private fields */ }
Expand description
Error returned from the various Bits methods.
This used to be a no-std 1:1 swap out with std::io::Error
, but it become more ergonomic to
simply use this error type everywhere.
Implementations§
Source§impl BitsError
impl BitsError
Sourcepub const fn new(kind: BitsErrorKind, msg: &'static str) -> Self
pub const fn new(kind: BitsErrorKind, msg: &'static str) -> Self
Creates a new error
Sourcepub const fn kind(&self) -> BitsErrorKind
pub const fn kind(&self) -> BitsErrorKind
Returns the error type/kind of this error
Sourcepub const fn err<T>(kind: BitsErrorKind, msg: &'static str) -> Result<T, Self>
pub const fn err<T>(kind: BitsErrorKind, msg: &'static str) -> Result<T, Self>
Creates an error variant of this type
Trait Implementations§
Source§impl Error for BitsError
impl Error for BitsError
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 From<BitsErrorKind> for BitsError
impl From<BitsErrorKind> for BitsError
Source§fn from(kind: BitsErrorKind) -> Self
fn from(kind: BitsErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for BitsError
Available on crate feature alloc
only.
impl From<FromUtf8Error> for BitsError
Available on crate feature
alloc
only.Source§fn from(_value: FromUtf8Error) -> Self
fn from(_value: FromUtf8Error) -> Self
Converts to this type from the input type.
impl Copy for BitsError
impl Eq for BitsError
impl StructuralPartialEq for BitsError
Auto Trait Implementations§
impl Freeze for BitsError
impl RefUnwindSafe for BitsError
impl Send for BitsError
impl Sync for BitsError
impl Unpin for BitsError
impl UnwindSafe for BitsError
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