pub struct Pair<T1, T2>(pub T1, pub T2);
Expand description
Type constructor to wrap two types into a tuple.
Sample
let i32_and_f32_in_tuple = type_constructor::Pair::< i32, f32 >::from( ( 13, 13.0 ) );
dbg!( i32_and_f32_in_tuple );
// vec_of_i32_in_tuple = Pair( 13, 13.0 )
Tuple Fields
0: T1
1: T2
Trait Implementations
sourceimpl<T1, T2, Into1, Into2> From<(Into1, Into2)> for Pair<T1, T2> where
Into1: Into<T1>,
Into2: Into<T2>,
impl<T1, T2, Into1, Into2> From<(Into1, Into2)> for Pair<T1, T2> where
Into1: Into<T1>,
Into2: Into<T2>,
sourcefn from(src: (Into1, Into2)) -> Pair<T1, T2>
fn from(src: (Into1, Into2)) -> Pair<T1, T2>
Converts to this type from the input type.
sourceimpl<T1, T2> PartialEq<Pair<T1, T2>> for Pair<T1, T2> where
T1: PartialEq<T1>,
T2: PartialEq<T2>,
impl<T1, T2> PartialEq<Pair<T1, T2>> for Pair<T1, T2> where
T1: PartialEq<T1>,
T2: PartialEq<T2>,
impl<T1, T2> Eq for Pair<T1, T2> where
T1: Eq,
T2: Eq,
impl<T1, T2> StructuralEq for Pair<T1, T2>
impl<T1, T2> StructuralPartialEq for Pair<T1, T2>
Auto Trait Implementations
impl<T1, T2> RefUnwindSafe for Pair<T1, T2> where
T1: RefUnwindSafe,
T2: RefUnwindSafe,
impl<T1, T2> Send for Pair<T1, T2> where
T1: Send,
T2: Send,
impl<T1, T2> Sync for Pair<T1, T2> where
T1: Sync,
T2: Sync,
impl<T1, T2> Unpin for Pair<T1, T2> where
T1: Unpin,
T2: Unpin,
impl<T1, T2> UnwindSafe for Pair<T1, T2> where
T1: UnwindSafe,
T2: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
sourceimpl<Target, Original> VectorizedInto<Target> for Original where
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Original where
Target: VectorizedFrom<Original>,
sourcefn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.