pub struct WrongSourceTypeError<T> {
pub expected_type: &'static str,
pub actual_type: &'static str,
pub general_type: PhantomData<T>,
}
Expand description
Error type used when the parameter of the type T
couldn’t be
converted into expected_type
because the received
type was actual_type
instead.
T
is the general type taken in the TryFrom
conversion.
Used for TryFrom
conversions from a general enum type to a specific member type.
Fields§
§expected_type: &'static str
The name of the specific type which TryFrom
tried to convert to.
actual_type: &'static str
The name of the actual type which TryFrom
received.
general_type: PhantomData<T>
The general type taken in the TryFrom
conversion.
Implementations§
Source§impl<T> WrongSourceTypeError<T>
impl<T> WrongSourceTypeError<T>
Sourcepub fn new(
expected_type: &'static str,
actual_type: &'static str,
) -> WrongSourceTypeError<T>
pub fn new( expected_type: &'static str, actual_type: &'static str, ) -> WrongSourceTypeError<T>
Creates a new instance of the error, taking T
as the general type from which
the conversion was tried and the expected_type
as the target type which it was tried to
convert it into, but failed because it was actually of the type named by actual_type
.
Trait Implementations§
Source§impl<T: Clone> Clone for WrongSourceTypeError<T>
impl<T: Clone> Clone for WrongSourceTypeError<T>
Source§fn clone(&self) -> WrongSourceTypeError<T>
fn clone(&self) -> WrongSourceTypeError<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for WrongSourceTypeError<T>
impl<T: Debug> Debug for WrongSourceTypeError<T>
Source§impl<T> Display for WrongSourceTypeError<T>
impl<T> Display for WrongSourceTypeError<T>
Source§impl<T> Error for WrongSourceTypeError<T>where
T: Debug,
impl<T> Error for WrongSourceTypeError<T>where
T: Debug,
1.30.0 · 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 From<WrongSourceTypeError<Value>> for ScopeFromValueError
impl From<WrongSourceTypeError<Value>> for ScopeFromValueError
Source§fn from(err: WrongSourceTypeError<Value>) -> Self
fn from(err: WrongSourceTypeError<Value>) -> Self
Converts to this type from the input type.
Source§impl<T: Hash> Hash for WrongSourceTypeError<T>
impl<T: Hash> Hash for WrongSourceTypeError<T>
Source§impl<T: PartialEq> PartialEq for WrongSourceTypeError<T>
impl<T: PartialEq> PartialEq for WrongSourceTypeError<T>
Source§fn eq(&self, other: &WrongSourceTypeError<T>) -> bool
fn eq(&self, other: &WrongSourceTypeError<T>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl<T: Eq> Eq for WrongSourceTypeError<T>
impl<T> StructuralPartialEq for WrongSourceTypeError<T>
Auto Trait Implementations§
impl<T> Freeze for WrongSourceTypeError<T>
impl<T> RefUnwindSafe for WrongSourceTypeError<T>where
T: RefUnwindSafe,
impl<T> Send for WrongSourceTypeError<T>where
T: Send,
impl<T> Sync for WrongSourceTypeError<T>where
T: Sync,
impl<T> Unpin for WrongSourceTypeError<T>where
T: Unpin,
impl<T> UnwindSafe for WrongSourceTypeError<T>where
T: 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