pub struct HierarchyEditGrant<T>(_);
Expand description

A token to keep the tree hierarchy granted to be edited.

A grant can be created by Tree::grant_hierarchy_edit or HotNode::extract_hierarchy_edit_grant.

A grant can be created by Tree::grant_hierarchy_edit or HotNode::extract_hierarchy_edit_grant.

Implementations

Clones the tree hierarchy edit grant.

Failures

Fails if the number of active edit grants for the tree exceeds isize::MAX.

Returns true if the grant is valid for the tree the given node belongs to.

Examples
use dendron::Node;

let node1 = Node::new_tree("foo");
let node2 = Node::new_tree("bar");

let grant1 = node1.tree()
    .grant_hierarchy_edit()
    .expect("hierarchy edit should not yet be prohibited");

assert!(grant1.is_valid_for_node(&node1));
assert!(!grant1.is_valid_for_node(&node2));

Trait Implementations

Clones the tree hierarchy edit grant.

If you want to avoid the risk of panic (even if it is very unlikely), use try_clone method.

Panics

Panics if the number of active edit grants for the tree will exceed isize::MAX.

Performs copy-assignment from source. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.