Trait bao_tree::io::fsm::OutboardMut

source ·
pub trait OutboardMut: Sized {
    type SaveFuture<'a>: Future<Output = Result<()>>
       where Self: 'a;
    type SyncFuture<'a>: Future<Output = Result<()>>
       where Self: 'a;

    // Required methods
    fn save<'a>(
        &'a mut self,
        node: TreeNode,
        hash_pair: &'a (Hash, Hash)
    ) -> Self::SaveFuture<'a>;
    fn sync(&mut self) -> Self::SyncFuture<'_>;
}
Expand description

A mutable outboard.

This trait extends Outboard with methods to save a hash pair for a node and to set the length of the data file.

This trait can be used to incrementally save an outboard when receiving data. If you want to just ignore outboard data, there is a special placeholder outboard implementation super::outboard::EmptyOutboard.

Required Associated Types§

source

type SaveFuture<'a>: Future<Output = Result<()>> where Self: 'a

Future returned by save

source

type SyncFuture<'a>: Future<Output = Result<()>> where Self: 'a

Future returned by sync

Required Methods§

source

fn save<'a>( &'a mut self, node: TreeNode, hash_pair: &'a (Hash, Hash) ) -> Self::SaveFuture<'a>

Save a hash pair for a node

source

fn sync(&mut self) -> Self::SyncFuture<'_>

sync to disk

Implementations on Foreign Types§

source§

impl<'b, O: OutboardMut> OutboardMut for &'b mut O

§

type SaveFuture<'a> = <O as OutboardMut>::SaveFuture<'a> where 'b: 'a

source§

fn save<'a>( &'a mut self, node: TreeNode, hash_pair: &'a (Hash, Hash) ) -> Self::SaveFuture<'a>

§

type SyncFuture<'a> = <O as OutboardMut>::SyncFuture<'a> where 'b: 'a

source§

fn sync(&mut self) -> Self::SyncFuture<'_>

Implementors§

source§

impl OutboardMut for EmptyOutboard

§

type SaveFuture<'a> = Ready<Result<(), Error>>

§

type SyncFuture<'a> = Ready<Result<(), Error>>

source§

impl<T: AsMut<[u8]>> OutboardMut for PostOrderMemOutboard<T>

§

type SaveFuture<'a> = Ready<Result<(), Error>> where T: 'a

§

type SyncFuture<'a> = Ready<Result<(), Error>> where T: 'a

source§

impl<T: AsMut<[u8]>> OutboardMut for PreOrderMemOutboard<T>

§

type SaveFuture<'a> = Ready<Result<(), Error>> where T: 'a

§

type SyncFuture<'a> = Ready<Result<(), Error>> where T: 'a

source§

impl<W: AsyncSliceWriter> OutboardMut for PreOrderOutboard<W>

§

type SaveFuture<'a> = Pin<Box<dyn Future<Output = Result<(), Error>> + 'a, Global>> where W: 'a

§

type SyncFuture<'a> = <W as AsyncSliceWriter>::SyncFuture<'a> where W: 'a