pub struct ExampleErrorStruct<T: ?Sized + 'static> { /* private fields */ }Expand description
An example of an error struct made by errormake
Implementations§
Source§impl ExampleErrorStruct<Infallible>
impl ExampleErrorStruct<Infallible>
Sourcepub fn new() -> ExampleErrorStruct<Infallible>
pub fn new() -> ExampleErrorStruct<Infallible>
Instantiate with no source or description
Sourcepub fn with_description(description: String) -> ExampleErrorStruct<Infallible>
pub fn with_description(description: String) -> ExampleErrorStruct<Infallible>
Instantiate with the given description and no source
Source§impl<T: 'static> ExampleErrorStruct<T>
impl<T: 'static> ExampleErrorStruct<T>
Sourcepub fn with_source(source: T) -> ExampleErrorStruct<T>
pub fn with_source(source: T) -> ExampleErrorStruct<T>
Instantiate with the given source and no description
Sourcepub fn with_source_and_description(
source: T,
description: String,
) -> ExampleErrorStruct<T>
pub fn with_source_and_description( source: T, description: String, ) -> ExampleErrorStruct<T>
Instantiate with the given source and description
Source§impl<T: ?Sized + 'static> ExampleErrorStruct<T>
impl<T: ?Sized + 'static> ExampleErrorStruct<T>
Sourcepub fn with_optional_data(
source: Option<Box<T>>,
description: Option<String>,
) -> ExampleErrorStruct<T>
pub fn with_optional_data( source: Option<Box<T>>, description: Option<String>, ) -> ExampleErrorStruct<T>
Instantiate with optional source and description determined by the arguments
Source§impl<T: Error + 'static> ExampleErrorStruct<T>
impl<T: Error + 'static> ExampleErrorStruct<T>
Sourcepub fn into_dynamic(self) -> ExampleErrorStruct<dyn Error + 'static>
pub fn into_dynamic(self) -> ExampleErrorStruct<dyn Error + 'static>
Convert the source error into a dynamic Error object, if it exists
Trait Implementations§
Source§impl<T: Clone + ?Sized + 'static> Clone for ExampleErrorStruct<T>
impl<T: Clone + ?Sized + 'static> Clone for ExampleErrorStruct<T>
Source§fn clone(&self) -> ExampleErrorStruct<T>
fn clone(&self) -> ExampleErrorStruct<T>
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<T: Default + ?Sized + 'static> Default for ExampleErrorStruct<T>
impl<T: Default + ?Sized + 'static> Default for ExampleErrorStruct<T>
Source§fn default() -> ExampleErrorStruct<T>
fn default() -> ExampleErrorStruct<T>
Returns the “default value” for a type. Read more
Source§impl<T> Error for ExampleErrorStruct<T>where
T: Error + 'static,
impl<T> Error for ExampleErrorStruct<T>where
T: Error + 'static,
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 Error for ExampleErrorStruct<dyn Error + 'static>
impl Error for ExampleErrorStruct<dyn Error + 'static>
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()
impl<T: Eq + ?Sized + 'static> Eq for ExampleErrorStruct<T>
impl<T: ?Sized + 'static> StructuralPartialEq for ExampleErrorStruct<T>
Auto Trait Implementations§
impl<T> Freeze for ExampleErrorStruct<T>where
T: ?Sized,
impl<T> RefUnwindSafe for ExampleErrorStruct<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for ExampleErrorStruct<T>
impl<T> Sync for ExampleErrorStruct<T>
impl<T> Unpin for ExampleErrorStruct<T>where
T: ?Sized,
impl<T> UnwindSafe for ExampleErrorStruct<T>where
T: UnwindSafe + ?Sized,
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