Trait ResourceCollection

Source
pub trait ResourceCollection<T>: Send + Sync {
    type Item: Serialize;

    // Required method
    fn collect(&self, items: Vec<T>) -> Vec<Self::Item>;

    // Provided methods
    fn with(&self) -> HashMap<String, Value> { ... }
    fn meta(&self) -> HashMap<String, Value> { ... }
}
Expand description

Trait for resource collections

Required Associated Types§

Source

type Item: Serialize

Collection data type

Required Methods§

Source

fn collect(&self, items: Vec<T>) -> Vec<Self::Item>

Transforms collection items

Provided Methods§

Source

fn with(&self) -> HashMap<String, Value>

Additional data to include with collection

Source

fn meta(&self) -> HashMap<String, Value>

Meta information

Implementors§