pub enum SynTree<T, U> {
Branch(Constituent<T>, Vec<SynTree<T, U>>),
Leaf(Word<U>),
}
Variants§
Implementations§
Source§impl<T, U> SynTree<T, U>
impl<T, U> SynTree<T, U>
pub fn is_leaf(&self) -> bool
pub fn is_branch(&self) -> bool
pub fn get_leaf(&self) -> Option<&Word<U>>
pub fn get_branch(&self) -> Option<(&Constituent<T>, &Vec<SynTree<T, U>>)>
pub fn into_branch(self) -> Option<(Constituent<T>, Vec<SynTree<T, U>>)>
pub fn map<V, W>( &self, map_branch: fn(&Constituent<T>) -> V, map_leaf: fn(&Word<U>) -> W, ) -> SynTree<V, W>
Trait Implementations§
impl<T, U> StructuralPartialEq for SynTree<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for SynTree<T, U>
impl<T, U> RefUnwindSafe for SynTree<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for SynTree<T, U>
impl<T, U> Sync for SynTree<T, U>
impl<T, U> Unpin for SynTree<T, U>
impl<T, U> UnwindSafe for SynTree<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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