pub struct DagBuilder { /* private fields */ }Expand description
Builder for creating Merkle DAG structures incrementally
Implementations§
Source§impl DagBuilder
impl DagBuilder
Sourcepub fn with_config(self, config: ChunkingConfig) -> Self
pub fn with_config(self, config: ChunkingConfig) -> Self
Set the chunking configuration
Sourcepub fn create_directory(
&self,
entries: Vec<(String, Cid, u64)>,
) -> Result<(DagNode, Block)>
pub fn create_directory( &self, entries: Vec<(String, Cid, u64)>, ) -> Result<(DagNode, Block)>
Create a directory-like DAG node from named entries
Sourcepub fn create_file(&self, data: &[u8]) -> Result<ChunkedFile>
pub fn create_file(&self, data: &[u8]) -> Result<ChunkedFile>
Create a simple file DAG from data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DagBuilder
impl RefUnwindSafe for DagBuilder
impl Send for DagBuilder
impl Sync for DagBuilder
impl Unpin for DagBuilder
impl UnwindSafe for DagBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more