diff --git a/src/ops/custom.rs b/src/ops/custom.rs index 28ff420cd..a458cd9cb 100644 --- a/src/ops/custom.rs +++ b/src/ops/custom.rs @@ -24,6 +24,14 @@ pub struct OpaqueOp { } impl OpaqueOp { + /// Initialize a new named OpaqueOp + pub fn new(id: impl Into, custom: Box) -> Self { + Self { + id: id.into(), + custom, + } + } + /// The name of the operation, cached for fast equality checks. pub fn name(&self) -> SmolStr { self.id.clone()