Trait RootCheckable

Source
pub trait RootCheckable<H: HugrView, Handle: NodeHandle<H::Node>>: Sized {
    // Required method
    fn try_into_checked(self) -> Result<RootChecked<H, Handle>, HugrError>;
}
Expand description

A trait for types that can be checked for a specific OpTag at their entrypoint node.

This is used mainly specifying function inputs that may either be a HugrView or an already checked RootChecked.

Required Methods§

Source

fn try_into_checked(self) -> Result<RootChecked<H, Handle>, HugrError>

Wrap the Hugr in a RootChecked if it is valid for the required OpTag.

If Self is already a RootChecked, it is a no-op.

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§

Source§

impl<H: HugrView, Handle: NodeHandle<H::Node>> RootCheckable<H, Handle> for RootChecked<H, Handle>

Source§

impl<H: HugrView, Handle: NodeHandle<H::Node>> RootCheckable<H, Handle> for H