pub struct EngineBuilder<T, M, R>where
T: Uniplate,
R: Rule<T, M>,{ /* private fields */ }Expand description
A builder type for constructing and configuring Engine instances.
Implementations§
Source§impl<T, M, R> EngineBuilder<T, M, R>where
T: Uniplate,
R: Rule<T, M>,
impl<T, M, R> EngineBuilder<T, M, R>where
T: Uniplate,
R: Rule<T, M>,
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new builder instance with the default select_first selector.
Sourcepub fn build(self) -> Engine<T, M, R>
pub fn build(self) -> Engine<T, M, R>
Consumes the builder and returns the constructed Engine instance.
Sourcepub fn add_rule_group(self, rules: Vec<R>) -> Self
pub fn add_rule_group(self, rules: Vec<R>) -> Self
Adds a collection of rules with the same priority.
These rules will have a lower priority than previously added groups.
Sourcepub fn add_rule(self, rule: R) -> Self
pub fn add_rule(self, rule: R) -> Self
Adds a single rule in a group by itself.
This is a special case of add_rule_group.
Sourcepub fn append_rule_groups(self, groups: Vec<Vec<R>>) -> Self
pub fn append_rule_groups(self, groups: Vec<Vec<R>>) -> Self
Adds a collection of rule groups to the existing one.
Rule groups maintain the same order and will be lower priority than existing groups.
Sourcepub fn add_before_up(self, handler: fn(&T, &mut M)) -> Self
pub fn add_before_up(self, handler: fn(&T, &mut M)) -> Self
Register an event handler to be called before moving $dir in the tree.
Sourcepub fn add_after_up(self, handler: fn(&T, &mut M)) -> Self
pub fn add_after_up(self, handler: fn(&T, &mut M)) -> Self
Register an event handler to be called after moving $dir one node in the tree.
Sourcepub fn add_before_down(self, handler: fn(&T, &mut M)) -> Self
pub fn add_before_down(self, handler: fn(&T, &mut M)) -> Self
Register an event handler to be called before moving $dir in the tree.
Sourcepub fn add_after_down(self, handler: fn(&T, &mut M)) -> Self
pub fn add_after_down(self, handler: fn(&T, &mut M)) -> Self
Register an event handler to be called after moving $dir one node in the tree.
Sourcepub fn add_before_right(self, handler: fn(&T, &mut M)) -> Self
pub fn add_before_right(self, handler: fn(&T, &mut M)) -> Self
Register an event handler to be called before moving $dir in the tree.
Sourcepub fn add_after_right(self, handler: fn(&T, &mut M)) -> Self
pub fn add_after_right(self, handler: fn(&T, &mut M)) -> Self
Register an event handler to be called after moving $dir one node in the tree.
Sourcepub fn set_selector(self, selector: SelectorFn<T, M, R>) -> Self
pub fn set_selector(self, selector: SelectorFn<T, M, R>) -> Self
Sets the selector function to be used when multiple rules are applicable to the same node.
See the morph method of the Engine type for more information.
Trait Implementations§
Source§impl<T, M, R> Default for EngineBuilder<T, M, R>where
T: Uniplate,
R: Rule<T, M>,
impl<T, M, R> Default for EngineBuilder<T, M, R>where
T: Uniplate,
R: Rule<T, M>,
Source§impl<T, M, R> From<EngineBuilder<T, M, R>> for Engine<T, M, R>where
T: Uniplate,
R: Rule<T, M>,
impl<T, M, R> From<EngineBuilder<T, M, R>> for Engine<T, M, R>where
T: Uniplate,
R: Rule<T, M>,
Source§fn from(val: EngineBuilder<T, M, R>) -> Self
fn from(val: EngineBuilder<T, M, R>) -> Self
Auto Trait Implementations§
impl<T, M, R> Freeze for EngineBuilder<T, M, R>
impl<T, M, R> RefUnwindSafe for EngineBuilder<T, M, R>where
R: RefUnwindSafe,
impl<T, M, R> Send for EngineBuilder<T, M, R>where
R: Send,
impl<T, M, R> Sync for EngineBuilder<T, M, R>where
R: Sync,
impl<T, M, R> Unpin for EngineBuilder<T, M, R>where
R: Unpin,
impl<T, M, R> UnwindSafe for EngineBuilder<T, M, R>where
R: 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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 176 bytes