pub struct StringError {
pub message: String,
}Expand description
A simple error type that wraps a string message.
Use this when you need a quick error without defining a custom error type.
Works with ErrorReport and ResultExt.
§Example
use charon_error::StringError;
let err = StringError::new("something went wrong");
assert_eq!(err.message, "something went wrong");Fields§
§message: StringThe error message text.
Implementations§
Trait Implementations§
Source§impl Clone for StringError
impl Clone for StringError
Source§fn clone(&self) -> StringError
fn clone(&self) -> StringError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StringError
impl Debug for StringError
Source§impl Default for StringError
impl Default for StringError
Source§fn default() -> StringError
fn default() -> StringError
Returns the “default value” for a type. Read more
Source§impl Display for StringError
impl Display for StringError
Source§impl Error for StringError
impl Error for StringError
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()
Auto Trait Implementations§
impl Freeze for StringError
impl RefUnwindSafe for StringError
impl Send for StringError
impl Sync for StringError
impl Unpin for StringError
impl UnsafeUnpin for StringError
impl UnwindSafe for StringError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
Source§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
The type of the wrapped error after instrumentation
Source§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
Instrument an Error by bundling it with a SpanTrace Read more