pub trait PatchVerification {
type Error: Error;
type Node: HugrNode;
// Required method
fn verify(
&self,
h: &impl HugrView<Node = Self::Node>,
) -> Result<(), Self::Error>;
// Provided methods
fn invalidation_set(&self) -> impl Iterator<Item = Self::Node> { ... }
fn invalidated_nodes(
&self,
h: &impl HugrView<Node = Self::Node>,
) -> impl Iterator<Item = Self::Node> { ... }
}
Expand description
Verify that a patch application would succeed.
Required Associated Types§
Required Methods§
Sourcefn verify(
&self,
h: &impl HugrView<Node = Self::Node>,
) -> Result<(), Self::Error>
fn verify( &self, h: &impl HugrView<Node = Self::Node>, ) -> Result<(), Self::Error>
Checks whether the rewrite would succeed on the specified Hugr.
If this call succeeds, Patch::apply
should also succeed on the same
h
If this calls fails, Patch::apply
would fail with the same
error.
Provided Methods§
Sourcefn invalidation_set(&self) -> impl Iterator<Item = Self::Node>
👎Deprecated: Use/implement invalidated_nodes instead
fn invalidation_set(&self) -> impl Iterator<Item = Self::Node>
The nodes invalidated by the rewrite. Deprecated: implement Self::invalidated_nodes instead. The default returns the empty iterator; this should be fine as there are no external calls.
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.