Emit

Trait Emit 

Source
pub trait Emit {
    // Required method
    fn emit_key_and_value<K, Value>(
        &self,
        key: K,
        value: Value,
    ) -> Result<Mappings<K, Value>, Error>;

    // Provided methods
    fn emit(&self) -> Result<Mappings<(), ()>, Error> { ... }
    fn emit_if(&self, condition: bool) -> Result<Mappings<(), ()>, Error> { ... }
    fn emit_key<K>(&self, key: K) -> Result<Mappings<K, ()>, Error> { ... }
    fn emit_value<Value>(
        &self,
        value: Value,
    ) -> Result<Mappings<(), Value>, Error> { ... }
}
Expand description

View mapping emit functions. Used when implementing a view’s map() function.

Required Methods§

Source

fn emit_key_and_value<K, Value>( &self, key: K, value: Value, ) -> Result<Mappings<K, Value>, Error>

Creates a Map result with a key and value.

Provided Methods§

Source

fn emit(&self) -> Result<Mappings<(), ()>, Error>

Creates a Map result with an empty key and value.

Source

fn emit_if(&self, condition: bool) -> Result<Mappings<(), ()>, Error>

Creates a Map result with an empty key and value if condition is true.

Source

fn emit_key<K>(&self, key: K) -> Result<Mappings<K, ()>, Error>

Creates a Map result with a key and an empty value.

Source

fn emit_value<Value>(&self, value: Value) -> Result<Mappings<(), Value>, Error>

Creates a Map result with value and an empty key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Emit for Header

Source§

impl<PrimaryKey> Emit for CollectionHeader<PrimaryKey>
where PrimaryKey: for<'k> Key<'k>,