pub struct Pair<First, Second>(pub First, pub Second);Expand description
Wraps two values.
A simple tuple struct that holds two values of potentially different types.
§Type Parameters
First: The type of the first value.Second: The type of the second value.
§Fields
0: The first value.1: The second value.
§Examples
use fp_library::types::*;
let p = Pair(1, "hello");
assert_eq!(p.0, 1);
assert_eq!(p.1, "hello");Tuple Fields§
§0: First§1: SecondTrait Implementations§
Source§impl<First: Ord, Second: Ord> Ord for Pair<First, Second>
impl<First: Ord, Second: Ord> Ord for Pair<First, Second>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<First: PartialOrd, Second: PartialOrd> PartialOrd for Pair<First, Second>
impl<First: PartialOrd, Second: PartialOrd> PartialOrd for Pair<First, Second>
impl<First: Copy, Second: Copy> Copy for Pair<First, Second>
impl<First: Eq, Second: Eq> Eq for Pair<First, Second>
impl<First, Second> StructuralPartialEq for Pair<First, Second>
Auto Trait Implementations§
impl<First, Second> Freeze for Pair<First, Second>
impl<First, Second> RefUnwindSafe for Pair<First, Second>where
First: RefUnwindSafe,
Second: RefUnwindSafe,
impl<First, Second> Send for Pair<First, Second>
impl<First, Second> Sync for Pair<First, Second>
impl<First, Second> Unpin for Pair<First, Second>
impl<First, Second> UnwindSafe for Pair<First, Second>where
First: UnwindSafe,
Second: 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