pub struct StdConverter;Expand description
A standard converter using the TryFrom trait.
This is the default converter used by Pair when no converter is specified.
Note that this converter requires the TryFrom<&L> for R and TryFrom<&R> for L
implementations, which are not typically implemented by the library authors.
Trait Implementations§
Source§impl Clone for StdConverter
impl Clone for StdConverter
Source§fn clone(&self) -> StdConverter
fn clone(&self) -> StdConverter
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<L, R, EL, ER> Converter<L, R> for StdConverter
impl<L, R, EL, ER> Converter<L, R> for StdConverter
Source§type ToLeftError = EL
type ToLeftError = EL
The error type returned when converting from right to left.
Source§type ToRightError = ER
type ToRightError = ER
The error type returned when converting from left to right.
Source§fn convert_to_left(&self, right: &R) -> Result<L, Self::ToLeftError>
fn convert_to_left(&self, right: &R) -> Result<L, Self::ToLeftError>
Converts a reference to a right value into a left value.
Source§fn convert_to_right(&self, left: &L) -> Result<R, Self::ToRightError>
fn convert_to_right(&self, left: &L) -> Result<R, Self::ToRightError>
Converts a reference to a left value into a right value.
Source§impl Debug for StdConverter
impl Debug for StdConverter
Source§impl Default for StdConverter
impl Default for StdConverter
Source§fn default() -> StdConverter
fn default() -> StdConverter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StdConverter
impl RefUnwindSafe for StdConverter
impl Send for StdConverter
impl Sync for StdConverter
impl Unpin for StdConverter
impl UnwindSafe for StdConverter
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