radicle_cob::object::collaboration

Trait Evaluate

Source
pub trait Evaluate<R>:
    Sized
    + Debug
    + 'static {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn init(entry: &Entry, store: &R) -> Result<Self, Self::Error>;
    fn apply<'a, I: Iterator<Item = (&'a Oid, &'a Entry)>>(
        &mut self,
        entry: &Entry,
        concurrent: I,
        store: &R,
    ) -> Result<(), Self::Error>;
}
Expand description

An object that can be built by evaluating a history.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn init(entry: &Entry, store: &R) -> Result<Self, Self::Error>

Initialize the object with the first (root) history entry.

Source

fn apply<'a, I: Iterator<Item = (&'a Oid, &'a Entry)>>( &mut self, entry: &Entry, concurrent: I, store: &R, ) -> Result<(), Self::Error>

Apply a history entry to the evaluated state.

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.

Implementations on Foreign Types§

Source§

impl<R> Evaluate<R> for NonEmpty<Entry>

Source§

type Error = Infallible

Source§

fn init(entry: &Entry, _store: &R) -> Result<Self, Self::Error>

Source§

fn apply<'a, I: Iterator<Item = (&'a Oid, &'a Entry)>>( &mut self, entry: &Entry, _concurrent: I, _store: &R, ) -> Result<(), Self::Error>

Implementors§