Skip to main content

compile_with

Function compile_with 

Source
pub fn compile_with(
    graph: &BlockGraph,
    config: CompileConfig,
) -> Result<CompileArtifacts, CompileError>
Expand description

Compile graph under config in a fresh context, returning the full CompileArtifacts.

§Errors

Any compilation error the graph provokes under config.

§Examples

use bloq_compile::{CompileConfig, compile_with};
use bloq_graph::GalleryItem;

let artifacts = compile_with(&GalleryItem::CNOT.build(), CompileConfig::default())?;
assert!(artifacts.warnings.is_empty());