[−][src]Struct syntax_tree::Tree
The syntax tree struct.
Methods
impl<T> Tree<T> where
T: Eq + Hash,
[src]
T: Eq + Hash,
pub fn new(string: &str, listener: Option<Listener<T>>) -> Tree<T>
[src]
Create new tree.
pub fn set(&mut self, start_idx: usize, end_idx: usize, info: T)
[src]
Set syntax/format info for the passed range. The range is the passed start index (inclusive) to the passed end index (exclusive).
pub fn unset(&mut self, start_idx: usize, end_idx: usize, info: T)
[src]
Unset the passed syntax/format info for the passed range. The range is the passed start index (inclusive) to the passed end index (exclusive).
pub fn insert(&mut self, idx: usize, ch: char)
[src]
Insert a char in the underlying text.
pub fn insert_str(&mut self, idx: usize, string: &str)
[src]
Insert a string in the underlying text.
pub fn push(&mut self, ch: char)
[src]
Push a char to the underlying text.
pub fn push_str(&mut self, string: &str)
[src]
Push a string to the underlying text.
pub fn length(&self) -> usize
[src]
Get the length of the underlying text.
pub fn remove(&mut self, idx: usize, count: usize)
[src]
Remove a count of characters from the underlying text starting at idx.
pub fn pop(&mut self)
[src]
Pop a char from the underlying text.
pub fn clear(&mut self, keep_formats: bool)
[src]
Clear the underlying text. Specify whether you want the tree to keep the formats on the root node.
pub fn get_root(&self) -> &Node<T>
[src]
Get the root node.
pub fn pre_order_iter(&self) -> PreOrder<T>
[src]
Get a depth first pre order iterator.
pub fn leaf_iter(&self) -> impl Iterator<Item = Item<T>>
[src]
Get a leaf iterator.
Trait Implementations
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,