Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Flatten LeafOp #922

Merged
merged 9 commits into from
Apr 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions hugr/src/ops/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ use crate::{
types::{EdgeKind, FunctionType, Type, TypeRow},
};

/// A user-defined operation that can be downcasted by the extensions that
/// define it.
/// A user-defined operation defined in an extension.
///
/// Any custom operation can be encoded as a serializable [`OpaqueOp`].
/// If the operation's extension is loaded in the current context, the operation
/// can be resolved to an executable [`ExtensionOp`].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"executable" doesn't seem right, don't we just mean that the extensionop refers to it's definition in the extension?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds better 👍

///
/// [`OpaqueOp`]: crate::ops::custom::OpaqueOp
/// [`ExtensionOp`]: crate::ops::custom::ExtensionOp
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct CustomOp(Box<ExternalOp>);

Expand Down