ErasedCommReducer

Trait ErasedCommReducer 

Source
pub trait ErasedCommReducer {
    // Required methods
    fn reduce_erased(&self, left: &Any, right: &Any) -> Result<Any>;
    fn typehash(&self) -> u64;

    // Provided method
    fn reduce_updates(
        &self,
        updates: Vec<Any>,
    ) -> Result<Any, (Error, Vec<Any>)> { ... }
}
Expand description

Type erased version of CommReducer.

Required Methods§

Source

fn reduce_erased(&self, left: &Any, right: &Any) -> Result<Any>

Reduce 2 updates into a single update.

Source

fn typehash(&self) -> u64

Typehash of the underlying CommReducer type.

Provided Methods§

Source

fn reduce_updates(&self, updates: Vec<Any>) -> Result<Any, (Error, Vec<Any>)>

Reducer an non-empty vector of updates. Return Error if the vector is empty.

Implementors§

Source§

impl<R, T> ErasedCommReducer for R
where R: CommReducer<Update = T> + Named, T: Serialize + DeserializeOwned + Named,