Struct unixfs_v1::dir::builder::BufferingTreeBuilder [−][src]
pub struct BufferingTreeBuilder { /* fields omitted */ }Expand description
UnixFs directory tree builder which buffers entries until build() is called.
Implementations
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>
pub fn set_metadata(
&mut self,
full_path: &str,
metadata: Metadata
) -> Result<(), TreeBuildingFailed>
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ⓘNotable traits for PostOrderIteratorimpl Iterator for PostOrderIterator type Item = Result<OwnedTreeNode, TreeConstructionFailed>;
pub fn build(self) -> PostOrderIteratorⓘNotable traits for PostOrderIteratorimpl Iterator for PostOrderIterator type Item = Result<OwnedTreeNode, TreeConstructionFailed>;
impl Iterator for PostOrderIterator type Item = Result<OwnedTreeNode, TreeConstructionFailed>;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.