Enum syntaxdot_encoders::lemma::EditTree[][src]

pub enum EditTree {
    MatchNode {
        pre: usize,
        suf: usize,
        left: Option<Box<EditTree>>,
        right: Option<Box<EditTree>>,
    },
    ReplaceNode {
        replacee: Vec<char>,
        replacement: Vec<char>,
    },
}

Enum representing a TreeNode of an Graph<TreeNode<T>,Place>.

Variants

MatchNode

Fields of MatchNode

pre: usizesuf: usizeleft: Option<Box<EditTree>>right: Option<Box<EditTree>>
ReplaceNode

Fields of ReplaceNode

replacee: Vec<char>replacement: Vec<char>

Implementations

impl EditTree[src]

pub fn create_tree(a: &[char], b: &[char]) -> Option<Self>[src]

Returns a edit tree specifying how to derive b from a.

Caution: when using with stringy types. UTF-8 multi byte chars will not be treated well. Consider passing in &char instead.

pub fn apply(&self, form: &[char]) -> Option<Vec<char>>[src]

Recursively applies the nodes stored in the edit tree. Returns None if the tree is not applicable to form.

Trait Implementations

impl Clone for EditTree[src]

impl Debug for EditTree[src]

impl<'de> Deserialize<'de> for EditTree[src]

impl Eq for EditTree[src]

impl Hash for EditTree[src]

impl PartialEq<EditTree> for EditTree[src]

impl Serialize for EditTree[src]

impl StructuralEq for EditTree[src]

impl StructuralPartialEq for EditTree[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.