pub struct Tree { /* private fields */ }
Implementations§
Source§impl Tree
impl Tree
pub fn new(name: impl AsRef<str>, icon: impl AsRef<str>) -> Self
pub fn from_encoding(tree: Tree) -> Self
pub fn into_encoding(&self) -> Tree
Sourcepub fn get_node_by_line(&self, line: usize) -> Option<Node>
pub fn get_node_by_line(&self, line: usize) -> Option<Node>
Get a Node
by line number.
0-indexed.
Sourcepub fn get_node_by_path<'a>(
&self,
path: impl IntoIterator<Item = &'a str>,
auto_create_nodes: bool,
) -> Option<Node>
pub fn get_node_by_path<'a>( &self, path: impl IntoIterator<Item = &'a str>, auto_create_nodes: bool, ) -> Option<Node>
Get a Node
by path, e.g. /root/a/b/c/d
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tree
impl<'de> Deserialize<'de> for Tree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Tree
impl !RefUnwindSafe for Tree
impl !Send for Tree
impl !Sync for Tree
impl Unpin for Tree
impl !UnwindSafe for Tree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more