Struct htrpc::Error

source ·
pub struct Error(_);
Expand description

This crate specific error type.

Methods from Deref<Target = TrackableError<ErrorKind>>§

source

pub fn kind(&self) -> &K

Returns the kind of this error.

source

pub fn concrete_cause<T>(&self) -> Option<&T>where T: Error + 'static,

Tries to return the cause of this error as a value of T type.

If neither this error has a cause nor it is an T value, this method will return None.

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Error

§

type Target = TrackableError<ErrorKind>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Error for Error

source§

fn custom<T>(msg: T) -> Selfwhere T: Display,

Used when a Serialize implementation encounters any error while serializing a type. Read more
source§

impl Error for Error

source§

fn custom<T>(msg: T) -> Selfwhere T: Display,

Raised when there is general error when deserializing a type. Read more
source§

fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a type different from what it was expecting. Read more
source§

fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a value of the right type but that is wrong for some other reason. Read more
source§

fn invalid_length(len: usize, exp: &dyn Expected) -> Self

Raised when deserializing a sequence or map and the input data contains too many or too few elements. Read more
source§

fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize enum type received a variant with an unrecognized name.
source§

fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize struct type received a field with an unrecognized name.
source§

fn missing_field(field: &'static str) -> Self

Raised when a Deserialize struct type expected to receive a required field with a particular name but that field was not present in the input.
source§

fn duplicate_field(field: &'static str) -> Self

Raised when a Deserialize struct type received more than one of the same field.
source§

impl<T> From<(Error, T)> for Error

source§

fn from((f, _): (Error, T)) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for TrackableError<ErrorKind>

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl From<ErrorKind> for Error

source§

fn from(f: ErrorKind) -> Self

Converts to this type from the input type.
source§

impl From<FromUtf8Error> for Error

source§

fn from(f: FromUtf8Error) -> Self

Converts to this type from the input type.
source§

impl<E: Into<Error>> From<Option<E>> for Error

source§

fn from(f: Option<E>) -> Self

Converts to this type from the input type.
source§

impl From<ParseBoolError> for Error

source§

fn from(f: ParseBoolError) -> Self

Converts to this type from the input type.
source§

impl From<ParseError> for Error

source§

fn from(f: ParseError) -> Self

Converts to this type from the input type.
source§

impl From<ParseFloatError> for Error

source§

fn from(f: ParseFloatError) -> Self

Converts to this type from the input type.
source§

impl From<ParseIntError> for Error

source§

fn from(f: ParseIntError) -> Self

Converts to this type from the input type.
source§

impl<A, B, C, D, E> From<Phase<A, B, C, D, E>> for Errorwhere Error: From<A> + From<B> + From<C> + From<D> + From<E>,

source§

fn from(f: Phase<A, B, C, D, E>) -> Self

Converts to this type from the input type.
source§

impl From<RecvError> for Error

source§

fn from(f: RecvError) -> Self

Converts to this type from the input type.
source§

impl From<TrackableError<ErrorKind>> for Error

source§

fn from(f: TrackableError<ErrorKind>) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for Error

source§

fn from(f: Utf8Error) -> Self

Converts to this type from the input type.
source§

impl Trackable for Error

§

type Event = Location

Event type which a history of an instance of this type can have.
source§

fn history(&self) -> Option<&History<Self::Event>>

Returns the reference of the tracking history of this instance. Read more
source§

fn history_mut(&mut self) -> Option<&mut History<Self::Event>>

Returns the mutable reference of the tracking history of this instance. Read more
source§

fn track<F>(&mut self, f: F)where F: FnOnce() -> Self::Event,

Add an event into the tail of the history of this instance. Read more
source§

fn in_tracking(&self) -> bool

Returns true if it is being tracked, otherwise false.

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn timeout<E>(self, delay_from_now: Duration) -> Timeout<Self>where Self: Future<Error = E>, E: From<Error>,

source§

fn write_all_bytes<B>(self, buf: B) -> WriteAllBytes<Self, B>where B: AsRef<[u8]>, Self: Write,

source§

fn read_all_bytes(self) -> ReadAllBytes<Self>where Self: Read,

source§

fn read_all_str(self) -> ReadAllStr<Self>where Self: Read,

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IoExt for T

source§

fn into_body_reader(self) -> Result<BodyReader<Self>, Error>where Self: Read + Metadata,

source§

fn max_length(self, max_len: u64) -> MaxLength<Self>where Self: Read,

source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.