Struct neodyn_xc::error::Error [−][src]
The central error type for Neodyn Exchange.
Implementations
impl Error
[src]
pub fn new<S>(message: S) -> Self where
S: Into<Cow<'static, str>>,
[src]
S: Into<Cow<'static, str>>,
Creates an error with the specified message, no cause, and a backtrace.
let error = Error::new("sample error message"); assert!(error.to_string().contains("sample error message")); assert!(error.reason().is_none()); assert!(error.stack_trace().is_some());
pub fn with_cause<S, E>(message: S, cause: E) -> Self where
S: Into<Cow<'static, str>>,
E: ErrorExt + 'static,
[src]
S: Into<Cow<'static, str>>,
E: ErrorExt + 'static,
Creates an error with the specified message and cause. If the cause has no backtrace, this method will create it and add it to the new instance.
let cause = "not a bool".parse::<bool>().unwrap_err(); assert!(cause.cause().is_none()); assert!(cause.stack_trace().is_none()); let error = Error::with_cause("top-level message", cause); assert!(error.to_string().contains("top-level message")); assert!(error.cause().unwrap().to_string().contains( "provided string was not `true` or `false`" )); assert!(error.stack_trace().is_some());
#[must_use]pub fn context<K>(&self) -> Option<&K::Value> where
K: Key,
K::Value: Debug + Send + Sync,
[src]
K: Key,
K::Value: Debug + Send + Sync,
Returns additional context info if any.
pub fn set_context<K>(&mut self, value: K::Value) -> Option<K::Value> where
K: Key,
K::Value: Debug + Send + Sync,
[src]
K: Key,
K::Value: Debug + Send + Sync,
Augments the error with additional context info.
pub fn with_context<K>(self, value: K::Value) -> Self where
K: Key,
K::Value: Debug + Send + Sync,
[src]
K: Key,
K::Value: Debug + Send + Sync,
Builder-style setter for agumenting the error with context info.
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
Displays the error. If the alternate flag ({:#}
) is set, also prints
the full stack trace.
impl Error for Error
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl Error for Error
[src]
impl Error for Error
[src]
TODO(H2CO3): implement the rest of the (provided) methods by retaining the structured information itself, not only the formatted error message.
fn custom<T: Display>(msg: T) -> Self
[src]
pub fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
[src]
pub fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
[src]
pub fn invalid_length(len: usize, exp: &dyn Expected) -> Self
[src]
pub fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
[src]
pub fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
[src]
pub fn missing_field(field: &'static str) -> Self
[src]
pub fn duplicate_field(field: &'static str) -> Self
[src]
impl ErrorExt for Error
[src]
fn reason(&self) -> Option<&(dyn ErrorExt + 'static)>
[src]
fn stack_trace(&self) -> Option<&Backtrace>
[src]
fn as_std_error(&self) -> &(dyn Error + 'static)
[src]
impl From<Error> for Error
[src]
impl From<FloatIsNan> for Error
[src]
fn from(error: FloatIsNan) -> Self
[src]
impl From<FromUtf8Error> for Error
[src]
fn from(error: FromUtf8Error) -> Self
[src]
impl From<ParseBoolError> for Error
[src]
fn from(error: ParseBoolError) -> Self
[src]
impl From<ParseFloatError> for Error
[src]
fn from(error: ParseFloatError) -> Self
[src]
impl From<ParseIntError> for Error
[src]
fn from(error: ParseIntError) -> Self
[src]
impl From<ParseNotNanError<ParseFloatError>> for Error
[src]
fn from(error: ParseNotNanError<ParseFloatError>) -> Self
[src]
impl From<TryFromIntError> for Error
[src]
fn from(error: TryFromIntError) -> Self
[src]
impl From<Utf8Error> for Error
[src]
impl<'de> IntoDeserializer<'de, Error> for Value
[src]
type Deserializer = Self
The type of the deserializer being converted into.
fn into_deserializer(self) -> Self::Deserializer
[src]
impl<'de> IntoDeserializer<'de, Error> for &'de Value
[src]
type Deserializer = Self
The type of the deserializer being converted into.
fn into_deserializer(self) -> Self::Deserializer
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,