pub struct ErrorWithOwnedValue<Error, State> { /* private fields */ }Expand description
A struct that combine an error with a owned value
Implementations§
Source§impl<Error, State> ErrorWithOwnedValue<Error, State>
impl<Error, State> ErrorWithOwnedValue<Error, State>
Sourcepub const fn new(error: Error, owned: State) -> Self
pub const fn new(error: Error, owned: State) -> Self
Create a new Self with an error and an owned value
Sourcepub fn deconstruct(self) -> (Error, State)
pub fn deconstruct(self) -> (Error, State)
Deconstruct the structure.
Sourcepub fn error_owned(self) -> Error
pub fn error_owned(self) -> Error
Deconstruct the structure returning the error and discarding the owned value.
Trait Implementations§
Source§impl<Error: Clone, State: Clone> Clone for ErrorWithOwnedValue<Error, State>
impl<Error: Clone, State: Clone> Clone for ErrorWithOwnedValue<Error, State>
Source§fn clone(&self) -> ErrorWithOwnedValue<Error, State>
fn clone(&self) -> ErrorWithOwnedValue<Error, State>
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<'de, Error, State> Deserialize<'de> for ErrorWithOwnedValue<Error, State>where
Error: Deserialize<'de>,
State: Deserialize<'de>,
impl<'de, Error, State> Deserialize<'de> for ErrorWithOwnedValue<Error, State>where
Error: Deserialize<'de>,
State: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<E: Display + Error + Debug + 'static, State: Display + Debug> Error for ErrorWithOwnedValue<E, State>
impl<E: Display + Error + Debug + 'static, State: Display + Debug> Error for ErrorWithOwnedValue<E, State>
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, State> From<(Error, State)> for ErrorWithOwnedValue<Error, State>
impl<Error, State> From<(Error, State)> for ErrorWithOwnedValue<Error, State>
Source§fn from(data: (Error, State)) -> Self
fn from(data: (Error, State)) -> Self
Converts to this type from the input type.
Source§impl<Error, Data1, Data2> From<ErrorWithOwnedValue<Error, (Data1, Data2)>> for ErrorWithOwnedValue<Error, Data1>
impl<Error, Data1, Data2> From<ErrorWithOwnedValue<Error, (Data1, Data2)>> for ErrorWithOwnedValue<Error, Data1>
Source§fn from(data: ErrorWithOwnedValue<Error, (Data1, Data2)>) -> Self
fn from(data: ErrorWithOwnedValue<Error, (Data1, Data2)>) -> Self
Converts to this type from the input type.
Source§impl<State> From<ErrorWithOwnedValue<StateInitializationError, State>> for StateInitializationError
impl<State> From<ErrorWithOwnedValue<StateInitializationError, State>> for StateInitializationError
Source§fn from(data: ErrorWithOwnedValue<StateInitializationError, State>) -> Self
fn from(data: ErrorWithOwnedValue<StateInitializationError, State>) -> Self
Converts to this type from the input type.
Source§impl<Error: Ord, State: Ord> Ord for ErrorWithOwnedValue<Error, State>
impl<Error: Ord, State: Ord> Ord for ErrorWithOwnedValue<Error, State>
Source§fn cmp(&self, other: &ErrorWithOwnedValue<Error, State>) -> Ordering
fn cmp(&self, other: &ErrorWithOwnedValue<Error, State>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Error: PartialEq, State: PartialEq> PartialEq for ErrorWithOwnedValue<Error, State>
impl<Error: PartialEq, State: PartialEq> PartialEq for ErrorWithOwnedValue<Error, State>
Source§fn eq(&self, other: &ErrorWithOwnedValue<Error, State>) -> bool
fn eq(&self, other: &ErrorWithOwnedValue<Error, State>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Error: PartialOrd, State: PartialOrd> PartialOrd for ErrorWithOwnedValue<Error, State>
impl<Error: PartialOrd, State: PartialOrd> PartialOrd for ErrorWithOwnedValue<Error, State>
Source§impl<Error, State> Serialize for ErrorWithOwnedValue<Error, State>
impl<Error, State> Serialize for ErrorWithOwnedValue<Error, State>
impl<Error: Copy, State: Copy> Copy for ErrorWithOwnedValue<Error, State>
impl<Error: Eq, State: Eq> Eq for ErrorWithOwnedValue<Error, State>
impl<Error, State> StructuralPartialEq for ErrorWithOwnedValue<Error, State>
Auto Trait Implementations§
impl<Error, State> Freeze for ErrorWithOwnedValue<Error, State>
impl<Error, State> RefUnwindSafe for ErrorWithOwnedValue<Error, State>where
Error: RefUnwindSafe,
State: RefUnwindSafe,
impl<Error, State> Send for ErrorWithOwnedValue<Error, State>
impl<Error, State> Sync for ErrorWithOwnedValue<Error, State>
impl<Error, State> Unpin for ErrorWithOwnedValue<Error, State>
impl<Error, State> UnwindSafe for ErrorWithOwnedValue<Error, State>where
Error: UnwindSafe,
State: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.