pub trait Emit {
fn emit_key_and_value<K, Value>(
&self,
key: K,
value: Value
) -> Result<Mappings<K, Value>, Error>
where
K: for<'a> Key<'a>;
fn emit(&self) -> Result<Mappings<(), ()>, Error> { ... }
fn emit_key<K>(&self, key: K) -> Result<Mappings<K, ()>, Error>
where
K: for<'a> Key<'a>,
{ ... }
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§
fn emit_key_and_value<K, Value>(
&self,
key: K,
value: Value
) -> Result<Mappings<K, Value>, Error>where
K: for<'a> Key<'a>,
fn emit_key_and_value<K, Value>(
&self,
key: K,
value: Value
) -> Result<Mappings<K, Value>, Error>where
K: for<'a> Key<'a>,
Creates a Map
result with a key
and value
.
Provided Methods§
fn emit_key<K>(&self, key: K) -> Result<Mappings<K, ()>, Error>where
K: for<'a> Key<'a>,
fn emit_key<K>(&self, key: K) -> Result<Mappings<K, ()>, Error>where
K: for<'a> Key<'a>,
Creates a Map
result with a key
and an empty value.
fn emit_value<Value>(&self, value: Value) -> Result<Mappings<(), Value>, Error>
fn emit_value<Value>(&self, value: Value) -> Result<Mappings<(), Value>, Error>
Creates a Map
result with value
and an empty key.