hugr_core::builder

Trait HugrBuilder

source
pub trait HugrBuilder: Container {
    // Required method
    fn finish_hugr(
        self,
        extension_registry: &ExtensionRegistry,
    ) -> Result<Hugr, ValidationError>;

    // Provided method
    fn finish_prelude_hugr(self) -> Result<Hugr, ValidationError>
       where Self: Sized { ... }
}
Expand description

Types implementing this trait can be used to build complete HUGRs (with varying root node types)

Required Methods§

source

fn finish_hugr( self, extension_registry: &ExtensionRegistry, ) -> Result<Hugr, ValidationError>

Finish building the HUGR, perform any validation checks and return it.

Provided Methods§

source

fn finish_prelude_hugr(self) -> Result<Hugr, ValidationError>
where Self: Sized,

Finish building the HUGR (as HugrBuilder::finish_hugr), validating against the prelude extension only

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.

Implementors§