Struct ketree::treebuilder::TreeBuilder
[−]
pub struct TreeBuilder { /* fields omitted */ }
Contains the code to be executed as a prologue, body, and epilogue.
Methods
impl TreeBuilder
[src]
fn new(body: &str) -> TreeBuilder
Creates a new TreeBuilder with provided 'body' code.
fn from_file(path: &str) -> Result<TreeBuilder, Error>
Creates a new TreeBuilder from a file.
fn set_prologue(&mut self, s: &str)
Sets the prologue to be executed.
fn set_epilogue(&mut self, s: &str)
Sets the epilogue to be executed.
fn use_box_and_name<T, B>(
&self,
cml: Box<B>,
tree_name: &str
) -> Result<(Tree<T>, HashSet<String>), Error> where
T: 'static + Clone + Debug,
B: 'static + ModuleLoader,
&self,
cml: Box<B>,
tree_name: &str
) -> Result<(Tree<T>, HashSet<String>), Error> where
T: 'static + Clone + Debug,
B: 'static + ModuleLoader,
Consumes a Box containing a ketos::ModuleLoader and takes a name to look for that the tree is assigned to (using define in the body of Ketos code).
Returns a tuple containing the Tree and a HashSet of variable names.
fn use_box_set_and_name<T, B>(
&self,
cml: Box<B>,
var_set: HashSet<String>,
tree_name: &str
) -> Result<(Tree<T>, HashSet<String>), Error> where
T: 'static + Clone + Debug,
B: 'static + ModuleLoader,
&self,
cml: Box<B>,
var_set: HashSet<String>,
tree_name: &str
) -> Result<(Tree<T>, HashSet<String>), Error> where
T: 'static + Clone + Debug,
B: 'static + ModuleLoader,
Consumes a Box containing a ketos::ModuleLoader, consumes a HashSet
Returns a tuple containing the Tree and the consumed HashSet filled with variable names.