[−][src]Struct ipfs_unixfs::dir::builder::BufferingTreeBuilder
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.
pub fn put_link(
&mut self,
full_path: &str,
target: Cid,
total_size: u64
) -> Result<(), TreeBuildingFailed>
[src]
&mut self,
full_path: &str,
target: Cid,
total_size: u64
) -> Result<(), TreeBuildingFailed>
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]
&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 PostOrderIterator
impl Iterator for PostOrderIterator type Item = Result<OwnedTreeNode, TreeConstructionFailed>;
[src]
Notable traits for PostOrderIterator
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
.
Trait Implementations
impl Debug for BufferingTreeBuilder
[src]
impl Default for BufferingTreeBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for BufferingTreeBuilder
impl Send for BufferingTreeBuilder
impl Sync for BufferingTreeBuilder
impl Unpin for BufferingTreeBuilder
impl UnwindSafe for BufferingTreeBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,