[−][src]Struct string_err::StringError
The string error type
See the crate documentation for examples on how to use this type.
Methods
impl StringError<(), ()>
[src]
pub fn new(msg: impl Into<String>) -> Self
[src]
Creates a new string error with no underlying error nor backtrace
This is not recommended to be used unless you really don't have an underlying
error, and even so, it might be more useful to use StringError::with_backtrace
,
as at least you would have some reference.
impl StringError<(), Backtrace>
[src]
pub fn with_backtrace(msg: impl Into<String>) -> Self
[src]
Creates a new string error with no underlying error, but with a backtrace
This is reccomended only when you don't have an underlying error.
impl<E: Sized> StringError<E, ()>
[src]
pub fn with_err<R: Into<E>>(msg: impl Into<String>) -> impl FnOnce(R) -> Self
[src]
Returns a function to be passed to map_err
, map_panic_err
or alike
that returns a string error with the underlying error but no backtrace
impl<E: Sized> StringError<E, Backtrace>
[src]
pub fn with_err_backtrace<R: Into<E>>(
msg: impl Into<String>
) -> impl FnOnce(R) -> Self
[src]
msg: impl Into<String>
) -> impl FnOnce(R) -> Self
Returns a function to be passed to map_err
, map_panic_err
or alike
that returns a string error with the underlying error and a backtrace
impl<E: ?Sized, B: MaybeBacktrace> StringError<E, B>
[src]
#[must_use]pub fn msg(&self) -> &str
[src]
Returns the current message within this error
#[must_use]pub fn err(&self) -> &E
[src]
Returns the current underlying error within error
#[must_use]pub fn backtrace_maybe(&self) -> Option<&Backtrace>
[src]
Returns the backtrace, if any
impl<E: ?Sized> StringError<E, Backtrace>
[src]
Trait Implementations
impl<E: ?Sized, B: MaybeBacktrace> Debug for StringError<E, B>
[src]
Default Debug
impl for all StringError<E, B>
impl<E: Sized + Debug, B: MaybeBacktrace> Debug for StringError<E, B>
[src]
Specialiation Debug
impl for E: Sized + Debug
impl<E: Default + ?Sized, B: Default + MaybeBacktrace> Default for StringError<E, B>
[src]
fn default() -> StringError<E, B>
[src]
impl<E: ?Sized, B: MaybeBacktrace> Display for StringError<E, B>
[src]
Display
implementation for all StringError<E, B>
impl<E: Eq + ?Sized, B: Eq + MaybeBacktrace> Eq for StringError<E, B>
[src]
impl<E: ?Sized, B: MaybeBacktrace> Error for StringError<E, B>
[src]
Default Error
impl for any all StringError<E, B>
default fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl<E: Error + 'static, B: MaybeBacktrace> Error for StringError<E, B>
[src]
Specialization Error
implementation for Error + 'static
types
Note: E
can't be ?Sized
because the pointer we'd return is a fat pointer
with the size and the vtable, which itself is ?Sized
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
Note: Not default
because if we do have a Error + 'static
underlying
error, we can always return it.
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl<E: Hash + ?Sized, B: Hash + MaybeBacktrace> Hash for StringError<E, B>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<E: PartialEq + ?Sized, B: PartialEq + MaybeBacktrace> PartialEq<StringError<E, B>> for StringError<E, B>
[src]
fn eq(&self, other: &StringError<E, B>) -> bool
[src]
fn ne(&self, other: &StringError<E, B>) -> bool
[src]
impl<E: ?Sized, B: MaybeBacktrace> StructuralEq for StringError<E, B>
[src]
impl<E: ?Sized, B: MaybeBacktrace> StructuralPartialEq for StringError<E, B>
[src]
Auto Trait Implementations
impl<E: ?Sized, B> RefUnwindSafe for StringError<E, B> where
B: RefUnwindSafe,
E: RefUnwindSafe,
B: RefUnwindSafe,
E: RefUnwindSafe,
impl<E: ?Sized, B> Send for StringError<E, B> where
B: Send,
E: Send,
B: Send,
E: Send,
impl<E: ?Sized, B> Sync for StringError<E, B> where
B: Sync,
E: Sync,
B: Sync,
E: Sync,
impl<E: ?Sized, B> Unpin for StringError<E, B> where
B: Unpin,
E: Unpin,
B: Unpin,
E: Unpin,
impl<E: ?Sized, B> UnwindSafe for StringError<E, B> where
B: UnwindSafe,
E: UnwindSafe,
B: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,