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§
sourcetype SaveFuture<'a>: Future<Output = Result<()>>
where
Self: 'a
type SaveFuture<'a>: Future<Output = Result<()>> where Self: 'a
Future returned by save
sourcetype SyncFuture<'a>: Future<Output = Result<()>>
where
Self: 'a
type SyncFuture<'a>: Future<Output = Result<()>> where Self: 'a
Future returned by sync
Required Methods§
sourcefn save<'a>(
&'a mut self,
node: TreeNode,
hash_pair: &'a (Hash, Hash)
) -> Self::SaveFuture<'a>
fn save<'a>( &'a mut self, node: TreeNode, hash_pair: &'a (Hash, Hash) ) -> Self::SaveFuture<'a>
Save a hash pair for a node
sourcefn sync(&mut self) -> Self::SyncFuture<'_>
fn sync(&mut self) -> Self::SyncFuture<'_>
sync to disk