Skip to content

Commit

Permalink
new for OpaqueOp
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Jun 29, 2023
1 parent 774e342 commit 9bc5cbb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ops/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ pub struct OpaqueOp {
}

impl OpaqueOp {
/// Initialize a new named OpaqueOp
pub fn new(id: impl Into<SmolStr>, custom: Box<dyn CustomOp>) -> Self {
Self {
id: id.into(),
custom,
}
}

/// The name of the operation, cached for fast equality checks.
pub fn name(&self) -> SmolStr {
self.id.clone()
Expand Down

0 comments on commit 9bc5cbb

Please sign in to comment.