pub struct Tree<T> { /* private fields */ }
Expand description
The syntax tree struct.
Implementations§
Source§impl<T> Tree<T>
impl<T> Tree<T>
Sourcepub fn set(&mut self, start_idx: usize, end_idx: usize, info: T)
pub fn set(&mut self, start_idx: usize, end_idx: usize, info: T)
Set syntax/format info for the passed range. The range is the passed start index (inclusive) to the passed end index (exclusive).
Sourcepub fn unset(&mut self, start_idx: usize, end_idx: usize, info: T)
pub fn unset(&mut self, start_idx: usize, end_idx: usize, info: T)
Unset the passed syntax/format info for the passed range. The range is the passed start index (inclusive) to the passed end index (exclusive).
Sourcepub fn insert_str(&mut self, idx: usize, string: &str)
pub fn insert_str(&mut self, idx: usize, string: &str)
Insert a string in the underlying text.
Sourcepub fn remove(&mut self, idx: usize, count: usize)
pub fn remove(&mut self, idx: usize, count: usize)
Remove a count of characters from the underlying text starting at idx.
Sourcepub fn clear(&mut self, keep_formats: bool)
pub fn clear(&mut self, keep_formats: bool)
Clear the underlying text. Specify whether you want the tree to keep the formats on the root node.
Sourcepub fn pre_order_iter(&self) -> PreOrder<'_, T> ⓘ
pub fn pre_order_iter(&self) -> PreOrder<'_, T> ⓘ
Get a depth first pre order iterator.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Tree<T>
impl<T> !RefUnwindSafe for Tree<T>
impl<T> !Send for Tree<T>
impl<T> !Sync for Tree<T>
impl<T> Unpin for Tree<T>
impl<T> !UnwindSafe for Tree<T>
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