[][src]Struct ipfs_unixfs::dir::builder::BufferingTreeBuilder

pub struct BufferingTreeBuilder { /* fields omitted */ }

UnixFs directory tree builder which buffers entries until build() is called.

Implementations

impl BufferingTreeBuilder[src]

pub fn new(opts: TreeOptions) -> Self[src]

Construct a new tree builder with the given configuration.

Registers the given path to be a link to the cid that follows. The target leaf should be either a file, directory or symlink but could of course be anything. It will be treated as an opaque link.

pub fn set_metadata(
    &mut self,
    full_path: &str,
    metadata: Metadata
) -> Result<(), TreeBuildingFailed>
[src]

Directories get "put" implicitly through the put files, and directories need to be adjusted only when wanting them to have metadata.

pub fn build(self) -> PostOrderIterator[src]

Called to build the tree. The built tree will have the added files and their implied directory structure, along with the directory entries which were created using set_metadata. To build the whole hierarchy, one must iterate the returned iterator to completion while storing the created blocks.

Returned PostOrderIterator will use the given full_path and block_buffer to store its data during the walk. PostOrderIterator implements Iterator while also allowing borrowed access via next_borrowed.

Trait Implementations

impl Debug for BufferingTreeBuilder[src]

impl Default for BufferingTreeBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.