INNER CODE UNIT · Rust
add_constructor
lurk-lab/lurk-beta · foil/src/lib.rs:252
fn add_constructor(&mut self, constructor: Func<M>, _metadata: &M) {
self.schema.constructors.push(constructor)
}
pub fn graph(&self) -> &G<M> {
&self.graph
}
pub fn graph_mut(&mut self) -> &mut G<M> {
&mut self.graph
}
pub fn alloc<L: Into<Label>>(&mut self, label: L) -> Vert {
let l = label.into();
let vert = self.graph.alloc(l.clone(), M::default());
self.register(&l, &vert);
vert
}
pub fn alloc_var(&mut self, name: &'static str) -> Vert {
self.alloc(Var::new(name))