pub struct Last<T>(pub T);Expand description
A no-op merge that retains the last value.
This type provides a merge implementation that always retains the other value.
The opposite of this is First.
§Example
let a = Last(vec![0, 1, 2]);
let b = Last(vec![3, 4]);
let merged = a.merge(b).unwrap();
assert_eq!(*merged, &[3, 4]);§serde
This type deserializes like T.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T> BorrowMut<T> for Last<T>
impl<T> BorrowMut<T> for Last<T>
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<'de, T> Deserialize<'de> for Last<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Last<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Ord> Ord for Last<T>
impl<T: Ord> Ord for Last<T>
Source§impl<T: PartialOrd> PartialOrd for Last<T>
impl<T: PartialOrd> PartialOrd for Last<T>
impl<T: Copy> Copy for Last<T>
impl<T: Eq> Eq for Last<T>
impl<T> StructuralPartialEq for Last<T>
Auto Trait Implementations§
impl<T> Freeze for Last<T>where
T: Freeze,
impl<T> RefUnwindSafe for Last<T>where
T: RefUnwindSafe,
impl<T> Send for Last<T>where
T: Send,
impl<T> Sync for Last<T>where
T: Sync,
impl<T> Unpin for Last<T>where
T: Unpin,
impl<T> UnwindSafe for Last<T>where
T: 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