Crate hugr_core

Source
Expand description

Extensible, graph-based program representation with first-class support for linear types.

This crate contains the core definitions for the HUGR representation. See the top-level crate documentation for more information.

Re-exports§

pub use crate::core::CircuitUnit;
pub use crate::core::Direction;
pub use crate::core::IncomingPort;
pub use crate::core::Node;
pub use crate::core::NodeIndex;
pub use crate::core::OutgoingPort;
pub use crate::core::Port;
pub use crate::core::PortIndex;
pub use crate::core::Wire;
pub use crate::extension::Extension;
pub use crate::hugr::Hugr;
pub use crate::hugr::HugrView;
pub use crate::hugr::SimpleReplacement;

Modules§

builder
Utilities for building valid HUGRs.
core
Definitions for the core types used in the Hugr.
envelope
Envelope format for HUGR packages.
export
Exporting HUGR graphs to their hugr-model representation.
extension
Extensions
hugr
The Hugr data structure, and its basic component handles.
import
Importing HUGR graphs from their hugr-model representation.
macros
Helper macros.
ops
The operation types for the HUGR.
package
Bundles of hugr modules along with the extension required to load them.
std_extensions
Experiments for Extension definitions.
types
General wire types used in the compiler
utils
General utilities.

Macros§

const_extension_ids
Declare ‘const’ variables holding new ExtensionIds, validating that they are well-formed as separate tests - hence, usable at the top level of a test module only. Example:
impl_serde_as_string_envelope
Implements serde_with::DeserializeAs and serde_with::SerializeAs for the helper to deserialize Hugr and Package types, using the given extension registry.
type_row
Creates a TypeRow backed by statically defined data, avoiding allocations.