Skip to main content

IGrouping

Trait IGrouping 

Source
pub trait IGrouping<T, K, G> {
    // Required methods
    fn count(&self) -> usize;
    fn items(&self) -> Vec<T>;
    fn key(&self) -> &G;
    fn keys(&self) -> Vec<K>;
    fn key_values(&self) -> Vec<(K, T)>;
    fn lookup(&self, key: &K) -> Option<T>;
}
Expand description

The state of a group at one moment (IGrouping<TObject, TKey, TGroupKey>): the items of the change sets of GroupWithImmutableState and GroupOnPropertyWithImmutableState, which replace a group with a new state whenever its items change.

Required Methods§

Source

fn count(&self) -> usize

The number of items (Count).

Source

fn items(&self) -> Vec<T>

The items (Items).

Source

fn key(&self) -> &G

The group key (Key).

Source

fn keys(&self) -> Vec<K>

The keys of the items (Keys).

Source

fn key_values(&self) -> Vec<(K, T)>

The keys with their items (KeyValues).

Source

fn lookup(&self, key: &K) -> Option<T>

The item of key (Lookup).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: Clone, K: Eq + Hash + Clone, G> IGrouping<T, K, G> for ImmutableGroup<T, K, G>