Skip to main content

StreamBuilder

Struct StreamBuilder 

Source
pub struct StreamBuilder<S: Store> { /* private fields */ }
๐Ÿ‘ŽDeprecated since 0.3.1:

use HashTree, which covers the same operations

Expand description

StreamBuilder - supports incremental appends

Implementationsยง

Sourceยง

impl<S: Store> StreamBuilder<S>

Source

pub fn new(config: BuilderConfig<S>) -> Self

Source

pub async fn append(&mut self, data: &[u8]) -> Result<(), BuilderError>

Append data to the stream

Source

pub async fn current_root(&mut self) -> Result<Option<Hash>, BuilderError>

Get current root hash without finalizing Useful for checkpoints

Source

pub async fn finalize(self) -> Result<(Hash, u64), BuilderError>

Finalize the stream and return root hash

Source

pub fn stats(&self) -> StreamStats

Get stats

Auto Trait Implementationsยง

ยง

impl<S> Forget for StreamBuilder<S>

ยง

impl<S> Freeze for StreamBuilder<S>
where Arc<S>: Freeze,

ยง

impl<S> RefUnwindSafe for StreamBuilder<S>
where Arc<S>: RefUnwindSafe,

ยง

impl<S> Send for StreamBuilder<S>
where Arc<S>: Send,

ยง

impl<S> Sync for StreamBuilder<S>
where Arc<S>: Sync,

ยง

impl<S> Unpin for StreamBuilder<S>
where Arc<S>: Unpin,

ยง

impl<S> UnsafeUnpin for StreamBuilder<S>
where Arc<S>: UnsafeUnpin,

ยง

impl<S> UnwindSafe for StreamBuilder<S>
where Arc<S>: UnwindSafe,

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Sourceยง

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = !

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V