pub struct ConversionOperationError<FromType, ToType> { /* private fields */ }Expand description
Represents a mismatch during conversion between the expected type and the actual value’s type; Holds the original value that was not able to be converted.
Implementations§
Source§impl<FromType, ToType> ConversionOperationError<FromType, ToType>
impl<FromType, ToType> ConversionOperationError<FromType, ToType>
pub fn new(input_value: FromType) -> Self
pub fn original_value(self) -> FromType
Trait Implementations§
Source§impl<FromType: Clone, ToType: Clone> Clone for ConversionOperationError<FromType, ToType>
impl<FromType: Clone, ToType: Clone> Clone for ConversionOperationError<FromType, ToType>
Source§fn clone(&self) -> ConversionOperationError<FromType, ToType>
fn clone(&self) -> ConversionOperationError<FromType, ToType>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<FromType, ToType> Display for ConversionOperationError<FromType, ToType>where
FromType: ValueTypeExpectation,
ToType: TypeExpectation,
impl<FromType, ToType> Display for ConversionOperationError<FromType, ToType>where
FromType: ValueTypeExpectation,
ToType: TypeExpectation,
Source§impl<FromType, ToType> Error for ConversionOperationError<FromType, ToType>
impl<FromType, ToType> Error for ConversionOperationError<FromType, ToType>
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<FromType, ToType> From<ConversionOperationError<FromType, ToType>> for IonErrorwhere
FromType: ValueTypeExpectation,
ToType: TypeExpectation,
impl<FromType, ToType> From<ConversionOperationError<FromType, ToType>> for IonErrorwhere
FromType: ValueTypeExpectation,
ToType: TypeExpectation,
Source§fn from(err: ConversionOperationError<FromType, ToType>) -> Self
fn from(err: ConversionOperationError<FromType, ToType>) -> Self
Converts to this type from the input type.
Source§impl<FromType, ToType> From<FromType> for ConversionOperationError<FromType, ToType>where
FromType: ValueTypeExpectation,
ToType: TypeExpectation,
impl<FromType, ToType> From<FromType> for ConversionOperationError<FromType, ToType>where
FromType: ValueTypeExpectation,
ToType: TypeExpectation,
Source§impl<FromType: PartialEq, ToType: PartialEq> PartialEq for ConversionOperationError<FromType, ToType>
impl<FromType: PartialEq, ToType: PartialEq> PartialEq for ConversionOperationError<FromType, ToType>
Source§fn eq(&self, other: &ConversionOperationError<FromType, ToType>) -> bool
fn eq(&self, other: &ConversionOperationError<FromType, ToType>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<FromType: PartialEq, ToType: PartialEq> StructuralPartialEq for ConversionOperationError<FromType, ToType>
Auto Trait Implementations§
impl<FromType, ToType> Freeze for ConversionOperationError<FromType, ToType>where
FromType: Freeze,
impl<FromType, ToType> RefUnwindSafe for ConversionOperationError<FromType, ToType>where
FromType: RefUnwindSafe,
ToType: RefUnwindSafe,
impl<FromType, ToType> Send for ConversionOperationError<FromType, ToType>
impl<FromType, ToType> Sync for ConversionOperationError<FromType, ToType>
impl<FromType, ToType> Unpin for ConversionOperationError<FromType, ToType>
impl<FromType, ToType> UnsafeUnpin for ConversionOperationError<FromType, ToType>where
FromType: UnsafeUnpin,
impl<FromType, ToType> UnwindSafe for ConversionOperationError<FromType, ToType>where
FromType: UnwindSafe,
ToType: 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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more