State

pub trait State: Sized + Clone {
    type Error: Error;
    type Header: Header;
    type Content: Fragment;

    // Required methods
    fn apply_block<'a, I>(
        &self,
        header: &Self::Header,
        contents: I,
    ) -> Result<Self, Self::Error>
       where I: IntoIterator<Item = &'a Self::Content>,
             Self::Content: 'a;
    fn apply_contents<'a, I>(&self, contents: I) -> Result<Self, Self::Error>
       where I: IntoIterator<Item = &'a Self::Content>,
             Self::Content: 'a;
}

Required Associated Types§

Required Methods§

Source

fn apply_block<'a, I>( &self, header: &Self::Header, contents: I, ) -> Result<Self, Self::Error>
where I: IntoIterator<Item = &'a Self::Content>, Self::Content: 'a,

yield a new block in the state

This will change the state in the sense that it acknowledge the creation of a new block in its internal state.

Source

fn apply_contents<'a, I>(&self, contents: I) -> Result<Self, Self::Error>
where I: IntoIterator<Item = &'a Self::Content>, Self::Content: 'a,

apply new block contents. This modify the state in small steps however it does not acknowledge the creation of a new block

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§