pub trait PatchVerification {
type Error: Error;
type Node: HugrNode;
// Required methods
fn verify(
&self,
h: &impl HugrView<Node = Self::Node>,
) -> Result<(), Self::Error>;
fn invalidation_set(&self) -> 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.
Sourcefn invalidation_set(&self) -> impl Iterator<Item = Self::Node>
fn invalidation_set(&self) -> impl Iterator<Item = Self::Node>
Returns a set of nodes referenced by the rewrite. Modifying any of these nodes will invalidate it.
Two impl Rewrite
s can be composed if their invalidation sets are
disjoint.
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.