Skip to main content

Pairs

Trait Pairs 

Source
pub trait Pairs<T1: DataTrait + ?Sized, T2: DataTrait + ?Sized>: Vector<DynPair<T1, T2>> {
    // Required methods
    fn sort_by_key(&mut self);
    fn dedup_by_key_keep_last(&mut self);
    fn push_refs(&mut self, item: (&T1, &T2));
    fn as_pairs(&self) -> &DynPairs<T1, T2>;
    fn as_pairs_mut(&mut self) -> &mut DynPairs<T1, T2>;
}
Expand description

A dynamically typed interface to LeanVec<Tup2<_,_>>

Required Methods§

Source

fn sort_by_key(&mut self)

Sort self by key.

Source

fn dedup_by_key_keep_last(&mut self)

Removes all but the last of consecutive elements in the vector for each key.

Source

fn push_refs(&mut self, item: (&T1, &T2))

Push a new element; clone its first and second components from item.

Source

fn as_pairs(&self) -> &DynPairs<T1, T2>

Cast any trait object that implements this trait to &DynPairs.

This method will not be needed once trait downcasting has been stabilized.

Source

fn as_pairs_mut(&mut self) -> &mut DynPairs<T1, T2>

Cast any trait object that implements this trait to &mut DynPairs.

This method will not be needed once trait downcasting has been stabilized.

Trait Implementations§

Source§

impl<T1, T2> Deserialize<Box<dyn Pairs<T1, T2>>, Deserializer> for ()

Source§

fn deserialize( &self, _deserializer: &mut Deserializer, ) -> Result<Box<DynPairs<T1, T2>>, <Deserializer as Fallible>::Error>

Deserializes using the given deserializer

Blanket Implementations§

Source§

impl<V, T1, T2> Erase<dyn Pairs<T1, T2>> for V
where V: Pairs<T1, T2> + ArchivedDBData, DeserializeImpl<V, dyn Pairs<T1, T2>>: DeserializeDyn<dyn Pairs<T1, T2>>, T1: DataTrait + ?Sized, T2: DataTrait + ?Sized,

Source§

fn erase(&self) -> &(dyn Pairs<T1, T2> + 'static)

Convert a reference to self into a reference to Trait.
Source§

fn erase_mut(&mut self) -> &mut (dyn Pairs<T1, T2> + 'static)

Convert a mutable reference to self into a mutable reference to Trait.
Source§

fn erase_box(self: Box<V>) -> Box<dyn Pairs<T1, T2>>

Convert Box<Self> into Box<Trait>.
Source§

fn erase_archived( archived: &<V as Archive>::Archived, ) -> &<dyn Pairs<T1, T2> as ArchiveTrait>::Archived

Convert a reference to an archived representation of Self into a reference to a trait object of type Trait::Archived.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T1, T2, Trait1, Trait2> Pairs<Trait1, Trait2> for LeanVec<Tup2<T1, T2>>
where T1: DBData + Erase<Trait1>, T2: DBData + Erase<Trait2>, Trait1: DataTrait + ?Sized, Trait2: DataTrait + ?Sized,

Private interface