pub trait HugrBuilder: Container {
// Required method
fn finish_hugr(self) -> Result<Hugr, ValidationError<Node>>;
// Provided method
fn module_root_builder(&mut self) -> ModuleBuilder<&mut Hugr> { ... }
}
Expand description
Types implementing this trait can be used to build complete HUGRs (with varying entrypoint node types)
Required Methods§
Sourcefn finish_hugr(self) -> Result<Hugr, ValidationError<Node>>
fn finish_hugr(self) -> Result<Hugr, ValidationError<Node>>
Finish building the HUGR, perform any validation checks and return it.
Provided Methods§
Sourcefn module_root_builder(&mut self) -> ModuleBuilder<&mut Hugr>
fn module_root_builder(&mut self) -> ModuleBuilder<&mut Hugr>
Allows adding definitions to the module root of which this builder is building a part
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.