Trait former::exposed::EntryToVal

source ·
pub trait EntryToVal<Collection> {
    type Val;

    // Required method
    fn entry_to_val(self) -> Self::Val;
}
Expand description

Facilitates the conversion of collection entries to their corresponding value representations.

This trait is utilized to transform an entry of a collection into a value, abstracting the operation of collections like vectors or hash maps. It ensures that even in complex collection structures, entries can be seamlessly managed and manipulated as values.

Required Associated Types§

source

type Val

The type of values stored in the collection. This might be distinct from Entry in complex collections. For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.

Required Methods§

source

fn entry_to_val(self) -> Self::Val

Converts an entry into a value representation specific to the type of collection. This conversion is crucial for handling operations on entries, especially when they need to be treated or accessed as individual values, such as retrieving the value part from a key-value pair in a hash map.

Implementors§

source§

impl<C, E> EntryToVal<C> for E
where C: Collection<Entry = E>,

§

type Val = <C as Collection>::Val