pub struct StdConverter<L, R>(/* private fields */);Expand description
A standard converter that uses the TryFrom trait for conversions.
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<L, R> Clone for StdConverter<L, R>
impl<L, R> Clone for StdConverter<L, R>
Source§impl<L, R> Converter<L, R> for StdConverter<L, R>
impl<L, R> Converter<L, R> for StdConverter<L, R>
Source§type ToLeftError<'a> = <&'a R as TryInto<L>>::Error
where
R: 'a
type ToLeftError<'a> = <&'a R as TryInto<L>>::Error where R: 'a
The error type returned when converting from right to left.
Source§type ToRightError<'a> = <&'a L as TryInto<R>>::Error
where
L: 'a
type ToRightError<'a> = <&'a L as TryInto<R>>::Error where L: 'a
The error type returned when converting from left to right.
Source§fn convert_to_left<'a>(&self, right: &'a R) -> Result<L, Self::ToLeftError<'a>>
fn convert_to_left<'a>(&self, right: &'a R) -> Result<L, Self::ToLeftError<'a>>
Converts a reference to a right value into a left value.
Source§fn convert_to_right<'a>(&self, left: &'a L) -> Result<R, Self::ToRightError<'a>>
fn convert_to_right<'a>(&self, left: &'a L) -> Result<R, Self::ToRightError<'a>>
Converts a reference to a left value into a right value.
Source§impl<L, R> Debug for StdConverter<L, R>
impl<L, R> Debug for StdConverter<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for StdConverter<L, R>
impl<L, R> RefUnwindSafe for StdConverter<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for StdConverter<L, R>
impl<L, R> Sync for StdConverter<L, R>
impl<L, R> Unpin for StdConverter<L, R>
impl<L, R> UnwindSafe for StdConverter<L, R>where
L: UnwindSafe,
R: 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 more