Struct rubbish::fs::Tree [] [src]

pub struct Tree { /* fields omitted */ }

A Tree represents an image of a tree-shaped data structure, sort of like a filesystem directoy. However, directories can have associated data (that is, there can be data at foo/bar and at foo/bar/bing).

Methods

impl Tree
[src]

Create a new tree with the given root hash

Create a new, empty tree

Store this tree into the given storage, returning its hash.

Return a tree containing new value at the designated path, replacing any existing value at that path. The storage is used to read any unresolved tree nodes, but nothing is written to storage.

Note that path elements and data can coexist, unlike a UNIX filesystem; that is, writing a value to "usr/bin" will not invalidate paths like "usr/bin/rustc".

Writing uses path copying to copy a minimal amount of tree data such that the original tree is not modified and a new tree is returned, sharing data where possible.

Return a tree with the value at the given path removed. Empty directories will be removed. The storage is used to read any unresolvedtree nodes, but nothing is written to storage. If the path is already missing, an unchanged copy of the tree is returned.

This operation uses path copying to copy a minimal amount of tree data such that the original tree is not modified and a new tree is returned, sharing data where possible.

Read the value at the given path in this tree, returning an error if this fails. If no value is set at the given path, that is considered an error.

Trait Implementations

impl Clone for Tree
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Tree
[src]

Formats the value using the given formatter.