pub struct StreamBuilder<S: Store> { /* private fields */ }Expand description
StreamBuilder - supports incremental appends
Implementations§
Source§impl<S: Store> StreamBuilder<S>
impl<S: Store> StreamBuilder<S>
pub fn new(config: BuilderConfig<S>) -> Self
Sourcepub async fn append(&mut self, data: &[u8]) -> Result<(), BuilderError>
pub async fn append(&mut self, data: &[u8]) -> Result<(), BuilderError>
Append data to the stream
Sourcepub async fn current_root(&mut self) -> Result<Option<Hash>, BuilderError>
pub async fn current_root(&mut self) -> Result<Option<Hash>, BuilderError>
Get current root hash without finalizing Useful for checkpoints
Sourcepub async fn finalize(self) -> Result<(Hash, u64), BuilderError>
pub async fn finalize(self) -> Result<(Hash, u64), BuilderError>
Finalize the stream and return root hash
Sourcepub fn stats(&self) -> StreamStats
pub fn stats(&self) -> StreamStats
Get stats
Auto Trait Implementations§
impl<S> Freeze for StreamBuilder<S>
impl<S> RefUnwindSafe for StreamBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for StreamBuilder<S>
impl<S> Sync for StreamBuilder<S>
impl<S> Unpin for StreamBuilder<S>
impl<S> UnsafeUnpin for StreamBuilder<S>
impl<S> UnwindSafe for StreamBuilder<S>where
S: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more