pub struct Pair<A, B> {
pub fst: A,
pub snd: B,
}Expand description
A symmetric product (non-dependent pair) for use with Sum.
Fields§
§fst: AFirst component.
snd: BSecond component.
Implementations§
Source§impl<A, B> Pair<A, B>
impl<A, B> Pair<A, B>
Sourcepub fn into_tuple(self) -> (A, B)
pub fn into_tuple(self) -> (A, B)
Convert to a tuple.
Sourcepub fn from_tuple(t: (A, B)) -> Self
pub fn from_tuple(t: (A, B)) -> Self
Convert from a tuple.
Trait Implementations§
impl<A: Eq, B: Eq> Eq for Pair<A, B>
impl<A, B> StructuralPartialEq for Pair<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Pair<A, B>
impl<A, B> RefUnwindSafe for Pair<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Pair<A, B>
impl<A, B> Sync for Pair<A, B>
impl<A, B> Unpin for Pair<A, B>
impl<A, B> UnsafeUnpin for Pair<A, B>where
A: UnsafeUnpin,
B: UnsafeUnpin,
impl<A, B> UnwindSafe for Pair<A, B>where
A: UnwindSafe,
B: 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