[−][src]Enum id_tree::InsertBehavior
Describes the possible behaviors of the Tree::insert
method.
Variants
AsRoot
Sets the root of the Tree
.
If there is already a root Node
present in the tree, that Node
is set as the first child
of the new root.
use id_tree::*; use id_tree::InsertBehavior::*; let mut tree: Tree<i32> = Tree::new(); tree.insert(Node::new(5), AsRoot).unwrap();
UnderNode(&'a NodeId)
Returns a Result
containing the NodeId
of the child that was added or a NodeIdError
if
one occurred.
Note: Adds the new Node to the end of its children.
use id_tree::*; use id_tree::InsertBehavior::*; let root_node = Node::new(1); let child_node = Node::new(2); let mut tree: Tree<i32> = Tree::new(); let root_id = tree.insert(root_node, AsRoot).unwrap(); tree.insert(child_node, UnderNode(&root_id)).unwrap();
Auto Trait Implementations
impl<'a> Send for InsertBehavior<'a>
impl<'a> Sync for InsertBehavior<'a>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,