Skip to main content

InteractsWithData

Trait InteractsWithData 

Source
pub trait InteractsWithData {
    type Value;
    type Item;

    // Required method
    fn data(&self) -> &Self::Value;

    // Provided methods
    fn all(&self) -> Self::Value
       where Self::Value: Clone { ... }
    fn exists(&self, key: &Self::Item) -> bool
       where Self::Value: Contains<Self::Item> { ... }
    fn has(&self, key: &Self::Item) -> bool
       where Self::Value: Contains<Self::Item> { ... }
    fn when_has<F>(&mut self, key: &Self::Item, closure: F)
       where Self::Value: Contains<Self::Item>,
             F: FnMut(&mut Self) { ... }
    fn filled(&self, key: &Self::Item) -> bool { ... }
    fn is_not_filled(&self, key: &Self::Item) -> bool { ... }
    fn any_filled(&self, keys: Vec<&Self::Item>) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn data(&self) -> &Self::Value

Get the data for the container.

Provided Methods§

Source

fn all(&self) -> Self::Value
where Self::Value: Clone,

Get all of the data

Source

fn exists(&self, key: &Self::Item) -> bool
where Self::Value: Contains<Self::Item>,

Does the data container the key?

Source

fn has(&self, key: &Self::Item) -> bool
where Self::Value: Contains<Self::Item>,

Does the data contain the key?

Source

fn when_has<F>(&mut self, key: &Self::Item, closure: F)
where Self::Value: Contains<Self::Item>, F: FnMut(&mut Self),

Execute the closure when the instnce contains the given key.

Source

fn filled(&self, key: &Self::Item) -> bool

Determine if the instance contains a non-empty value for the key.

Source

fn is_not_filled(&self, key: &Self::Item) -> bool

Determine if the instance contains an empty value for the key.

Source

fn any_filled(&self, keys: Vec<&Self::Item>) -> bool

Do any of the given keys contain a non-empty value?

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<K: Eq + Hash, V: BuildHasher> InteractsWithData for HashSet<K, V>

Source§

type Value = HashSet<K, V>

Source§

type Item = K

Source§

fn data(&self) -> &Self::Value

Source§

impl<K: Eq + Hash, V> InteractsWithData for BTreeMap<K, V>

Source§

type Value = BTreeMap<K, V>

Source§

type Item = K

Source§

fn data(&self) -> &Self::Value

Source§

impl<K: Eq + Hash, V> InteractsWithData for HashMap<K, V>

Source§

type Value = HashMap<K, V>

Source§

type Item = K

Source§

fn data(&self) -> &Self::Value

Source§

impl<T, const N: usize> InteractsWithData for [T; N]

Source§

type Value = [T; N]

Source§

type Item = T

Source§

fn data(&self) -> &Self::Value

Source§

impl<T: Clone + PartialEq> InteractsWithData for Option<T>

Source§

type Value = Option<T>

Source§

type Item = T

Source§

fn data(&self) -> &Self::Value

Source§

fn exists(&self, key: &Self::Item) -> bool

Source§

impl<T: Clone + PartialEq> InteractsWithData for Vec<T>

Source§

type Value = Vec<T>

Source§

type Item = T

Source§

fn data(&self) -> &Self::Value

Source§

impl<T: Clone + PartialEq> InteractsWithData for VecDeque<T>

Source§

type Value = VecDeque<T>

Source§

type Item = T

Source§

fn data(&self) -> &Self::Value

Source§

impl<T: PartialEq, E> InteractsWithData for Result<T, E>

Source§

type Value = Result<T, E>

Source§

type Item = T

Source§

fn data(&self) -> &Self::Value

Source§

fn exists(&self, key: &Self::Item) -> bool

Source§

impl<T> InteractsWithData for LinkedList<T>

Source§

type Value = LinkedList<T>

Source§

type Item = T

Source§

fn data(&self) -> &Self::Value

Implementors§