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

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

A prohibition can be created by Tree::prohibit_hierarchy_edit or FrozenNode::extract_hierarchy_edit_prohibition.

Implementations§

Clones the tree hierarchy edit prohibition.

Failures

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

Returns true if the prohibition 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 prohibition1 = node1.tree()
    .prohibit_hierarchy_edit()
    .expect("hierarchy edit should not yet be granted");

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

Trait Implementations§

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 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.