hugr_core::ops

Trait OpTrait

source
pub trait OpTrait {
    // Required methods
    fn description(&self) -> &str;
    fn tag(&self) -> OpTag;

    // Provided methods
    fn dataflow_signature(&self) -> Option<Signature> { ... }
    fn extension_delta(&self) -> ExtensionSet { ... }
    fn other_input(&self) -> Option<EdgeKind> { ... }
    fn other_output(&self) -> Option<EdgeKind> { ... }
    fn static_input(&self) -> Option<EdgeKind> { ... }
    fn static_output(&self) -> Option<EdgeKind> { ... }
    fn non_df_port_count(&self, dir: Direction) -> usize { ... }
}
Expand description

Trait implemented by all OpType variants.

Required Methods§

source

fn description(&self) -> &str

A human-readable description of the operation.

source

fn tag(&self) -> OpTag

Tag identifying the operation.

Provided Methods§

source

fn dataflow_signature(&self) -> Option<Signature>

The signature of the operation.

Only dataflow operations have a signature, otherwise returns None.

source

fn extension_delta(&self) -> ExtensionSet

The delta between the input extensions specified for a node, and the output extensions calculated for that node

source

fn other_input(&self) -> Option<EdgeKind>

The edge kind for the non-dataflow inputs of the operation, not described by the signature.

If not None, a single extra input port of that kind will be present.

source

fn other_output(&self) -> Option<EdgeKind>

The edge kind for the non-dataflow outputs of the operation, not described by the signature.

If not None, a single extra output port of that kind will be present.

source

fn static_input(&self) -> Option<EdgeKind>

The edge kind for a single constant input of the operation, not described by the dataflow signature.

If not None, an extra input port of that kind will be present after the dataflow input ports and before any OpTrait::other_input ports.

source

fn static_output(&self) -> Option<EdgeKind>

The edge kind for a single constant output of the operation, not described by the dataflow signature.

If not None, an extra output port of that kind will be present after the dataflow input ports and before any OpTrait::other_output ports.

source

fn non_df_port_count(&self, dir: Direction) -> usize

Get the number of non-dataflow multiports.

Implementors§