pub trait FromString {
type Source;
// Required methods
fn without_source(message: String) -> Self;
fn with_source(source: Self::Source, message: String) -> Self;
}
Expand description
Takes a string message and builds the corresponding error.
It is expected that most users of SNAFU will not directly interact with this trait.
Required Associated Types§
Required Methods§
Sourcefn without_source(message: String) -> Self
fn without_source(message: String) -> Self
Create a brand new error from the given string
Sourcefn with_source(source: Self::Source, message: String) -> Self
fn with_source(source: Self::Source, message: String) -> Self
Wrap an existing error with the given string
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.