[−][src]Trait orga::collections::Entry

pub trait Entry {
    type Key: Encode + Decode;
    type Value: Encode + Decode;
    fn into_entry(self) -> (Self::Key, Self::Value);
fn from_entry(entry: (Self::Key, Self::Value)) -> Self; }

A trait for types which can be converted to or from a key/value pair.

This is useful when it is conceptually easier to think about values as singular structs while storing them in a map as a key/value pair.

Associated Types

type Key: Encode + Decode

Represents the key type for the key/value pair.

type Value: Encode + Decode

Represents the value type for the key/value pair.

Loading content...

Required methods

fn into_entry(self) -> (Self::Key, Self::Value)

Converts the entry type into its corresponding key and value types.

fn from_entry(entry: (Self::Key, Self::Value)) -> Self

Converts from the key and value types into the entry type.

Loading content...

Implementors

Loading content...