#[non_exhaustive]pub enum CompileError {
Show 41 variants
Cancelled(ComputationCancelled),
BooleanResource(BooleanResourceError),
InvalidDistance(u32),
CompiledObjectTargetMismatch {
object: Box<CompileConfig>,
linker: Box<CompileConfig>,
},
MissingModulePhysicalVariant {
module: String,
local_position: IVec3,
linked_position: IVec3,
signature: String,
},
CliffordProxyPinCount {
expected: usize,
actual: usize,
},
SelectiveArmSignatureMismatch {
kind: SelectiveKind,
reason: String,
},
InvalidConnectivity {
kind: BlockKind,
connectivity: Connectivity,
},
MissingBoundaryBasis {
kind: BlockKind,
},
SpatialPortNeighborNotCube {
port: IVec3,
neighbor: IVec3,
},
SpatialPortCubeInferenceFailed {
port: IVec3,
},
TallSpatialPortUnsupported {
port: IVec3,
height: CubeHeight,
},
MultiplexOutputCoordinateUnavailable {
port: IVec3,
},
SpatialHadamardUnsupportedEndpoint {
pos: IVec3,
},
MixedSpatialHadamardUnsupported {
pos: IVec3,
},
CubeHeightTooShort {
pos: IVec3,
height: CubeHeight,
distance: u32,
rounds: i64,
},
BlockLayoutCoordinateOverflow {
block_xy: IVec2,
distance: u32,
},
OverlappingNodeQubit {
first: BloqNodeId,
second: BloqNodeId,
qubit: IVec2,
},
PatchRotationConstructionFailed {
reason: String,
},
NodeFlowCompositionFailed {
layer: i64,
members: Vec<IVec3>,
source: FlowError,
},
DetectorFlowCompositionFailed {
source: FlowError,
},
LoopBoundaryMovingOperatorUnsupported,
ConditionalPauliFeedbackUnsupported,
TBlockNeedsFreeNeighbor {
pos: IVec3,
},
WalkingConstruction(WalkError),
ObservableMissingGatewayEntry {
block_pos: IVec3,
observable_index: u32,
local_stabilizer: String,
},
ObservableSeamMismatch {
observable_index: u32,
lower: IVec3,
upper: IVec3,
},
BranchAssembly {
reason: String,
},
StructuralBranchCliffordProxyUnsupported,
PaddingRoundsZero,
Edit(EditError),
BloqValidation(BloqValidationError),
CoordinateOverflow(CoordinateOverflowError),
LogicalBoundaryRebaseOverflow {
coordinate: IVec2,
offset: IVec2,
},
Circuit(CircuitError),
RuntimeBasis(RuntimeBasisError),
SymbolicBasis(SymbolicBasisError),
OutputCorrection(OutputCorrectionError),
BlockGraph(BlockGraphError),
ModuleCertification(ModuleCertificationError),
Module(Box<ModuleError>),
}Expand description
An error raised while validating or compiling a BlockGraph.
Variants cover invalid configuration, unsupported or malformed blocks, observable/detector composition failures, and errors forwarded from the graph, circuit, and IR layers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cancelled(ComputationCancelled)
The caller cancelled compilation at a safe checkpoint.
BooleanResource(BooleanResourceError)
Compiler-configured Boolean analysis exceeded a resource limit.
InvalidDistance(u32)
The requested code distance is outside the supported odd range.
CompiledObjectTargetMismatch
A compiled object was linked under a different compile configuration.
Fields
object: Box<CompileConfig>Configuration used to build the object.
linker: Box<CompileConfig>Configuration used by the linker.
MissingModulePhysicalVariant
A linked module site has no compiled template matching its physical signature.
Fields
local_position: IVec3Site position within the definition.
linked_position: IVec3Site position after module linking.
CliffordProxyPinCount
A Clifford proxy received the wrong number of selective-block pins.
SelectiveArmSignatureMismatch
The two per-basis arms must present the same output signature.
Fields
kind: SelectiveKindSelective block whose arms disagree.
InvalidConnectivity
A block’s connected faces are unsupported by fixed-bulk lowering.
Fields
connectivity: ConnectivityUnsupported face connectivity.
MissingBoundaryBasis
A temporal leaf block has no neighboring boundary basis.
SpatialPortNeighborNotCube
A spatial port is connected to a block that cannot supply cube geometry.
SpatialPortCubeInferenceFailed
A spatial port’s virtual cube kind could not be inferred.
Fields
port: IVec3Spatial port position.
TallSpatialPortUnsupported
A spatial port borders a cube taller than the substitution supports.
No unused coordinate is available for a multiplexed logical output.
SpatialHadamardUnsupportedEndpoint
A spatial Hadamard wall endpoint is not a cube.
Fields
pos: IVec3Unsupported endpoint position.
MixedSpatialHadamardUnsupported
One spatial component contains Hadamard walls on both spatial axes.
Fields
pos: IVec3Position identifying the mixed-axis component.
CubeHeightTooShort
A cube height resolves to fewer than two syndrome rounds.
BlockLayoutCoordinateOverflow
A block position cannot be mapped into the signed physical coordinate range.
Fields
block_xy: IVec2Block’s spatial coordinate.
OverlappingNodeQubit
Two same-layer nodes own the same physical qubit.
Fields
first: BloqNodeIdFirst conflicting node.
second: BloqNodeIdSecond conflicting node.
qubit: IVec2Shared physical coordinate.
PatchRotationConstructionFailed
Patch-rotation circuit construction failed.
NodeFlowCompositionFailed
Stabilizer-flow composition failed for one physical node.
Fields
DetectorFlowCompositionFailed
Program detector-flow composition failed.
LoopBoundaryMovingOperatorUnsupported
A repeat boundary contains an unsupported moving residual operator.
ConditionalPauliFeedbackUnsupported
A generated conditional Pauli cannot use the supported feedback paths.
TBlockNeedsFreeNeighbor
A T block has no free neighboring cell for its cultivation spill.
Fields
pos: IVec3T-block position.
WalkingConstruction(WalkError)
Walking-block circuit construction failed.
ObservableMissingGatewayEntry
Observable lowering found no gateway entry for a local stabilizer.
Fields
block_pos: IVec3Source block position.
ObservableSeamMismatch
A logical boundary operator disagrees across a temporal seam.
BranchAssembly
Continuing-branch assembly cannot be scheduled.
StructuralBranchCliffordProxyUnsupported
A Clifford proxy was requested for a graph with structural branches.
PaddingRoundsZero
Memory padding was requested with zero rounds.
Edit(EditError)
An IR seam edit failed.
BloqValidation(BloqValidationError)
The generated Bloq program failed validation.
CoordinateOverflow(CoordinateOverflowError)
Physical coordinate arithmetic overflowed.
LogicalBoundaryRebaseOverflow
Rebasing a logical boundary exceeded the signed coordinate range.
Circuit(CircuitError)
Circuit construction failed.
RuntimeBasis(RuntimeBasisError)
Runtime stabilizer-basis construction failed.
SymbolicBasis(SymbolicBasisError)
Symbolic stabilizer-basis construction failed.
OutputCorrection(OutputCorrectionError)
Logical output-correction construction failed.
BlockGraph(BlockGraphError)
Source block-graph validation or analysis failed.
ModuleCertification(ModuleCertificationError)
Module certification failed.
Module(Box<ModuleError>)
Hierarchical block-graph validation or linking failed.
Implementations§
Source§impl CompileError
impl CompileError
Sourcepub fn is_resource_limited(&self) -> bool
pub fn is_resource_limited(&self) -> bool
Whether computation stopped at a work or allocation budget, rather than proving the source or resulting IR invalid.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the caller cancelled this computation, including a forwarded graph-analysis failure.
Sourcepub fn resource_limit_help(&self) -> Option<&'static str>
pub fn resource_limit_help(&self) -> Option<&'static str>
Configuration help when a compilation-certification limit was exceeded.
Standalone IR validation and circuit-flattening limits have separate configuration contracts and return no certification hint here.
Trait Implementations§
Source§impl Debug for CompileError
impl Debug for CompileError
Source§impl Display for CompileError
impl Display for CompileError
Source§impl Error for CompileError
impl Error for CompileError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BlockGraphError> for CompileError
impl From<BlockGraphError> for CompileError
Source§fn from(source: BlockGraphError) -> Self
fn from(source: BlockGraphError) -> Self
Source§impl From<BloqValidationError> for CompileError
impl From<BloqValidationError> for CompileError
Source§fn from(source: BloqValidationError) -> Self
fn from(source: BloqValidationError) -> Self
Source§impl From<BooleanResourceError> for CompileError
impl From<BooleanResourceError> for CompileError
Source§fn from(source: BooleanResourceError) -> Self
fn from(source: BooleanResourceError) -> Self
Source§impl From<Box<ModuleError>> for CompileError
impl From<Box<ModuleError>> for CompileError
Source§fn from(source: Box<ModuleError>) -> Self
fn from(source: Box<ModuleError>) -> Self
Source§impl From<CircuitError> for CompileError
impl From<CircuitError> for CompileError
Source§fn from(source: CircuitError) -> Self
fn from(source: CircuitError) -> Self
Source§impl From<ComputationCancelled> for CompileError
impl From<ComputationCancelled> for CompileError
Source§fn from(source: ComputationCancelled) -> Self
fn from(source: ComputationCancelled) -> Self
Source§impl From<CoordinateOverflowError> for CompileError
impl From<CoordinateOverflowError> for CompileError
Source§fn from(source: CoordinateOverflowError) -> Self
fn from(source: CoordinateOverflowError) -> Self
Source§impl From<EditError> for CompileError
impl From<EditError> for CompileError
Source§impl From<InvalidDistance> for CompileError
impl From<InvalidDistance> for CompileError
Source§fn from(err: InvalidDistance) -> Self
fn from(err: InvalidDistance) -> Self
Source§impl From<ModuleCertificationError> for CompileError
impl From<ModuleCertificationError> for CompileError
Source§fn from(source: ModuleCertificationError) -> Self
fn from(source: ModuleCertificationError) -> Self
Source§impl From<ModuleError> for CompileError
impl From<ModuleError> for CompileError
Source§fn from(error: ModuleError) -> Self
fn from(error: ModuleError) -> Self
Source§impl From<OutputCorrectionError> for CompileError
impl From<OutputCorrectionError> for CompileError
Source§fn from(source: OutputCorrectionError) -> Self
fn from(source: OutputCorrectionError) -> Self
Source§impl From<RuntimeBasisError> for CompileError
impl From<RuntimeBasisError> for CompileError
Source§fn from(source: RuntimeBasisError) -> Self
fn from(source: RuntimeBasisError) -> Self
Source§impl From<SymbolicBasisError> for CompileError
impl From<SymbolicBasisError> for CompileError
Source§fn from(source: SymbolicBasisError) -> Self
fn from(source: SymbolicBasisError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CompileError
impl !UnwindSafe for CompileError
impl Freeze for CompileError
impl Send for CompileError
impl Sync for CompileError
impl Unpin for CompileError
impl UnsafeUnpin for CompileError
Blanket Implementations§
§impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
fn assign_index(&mut self, index: usize, to: bool)
fn negate_index(&mut self, index: usize)
fn clear_bits(&mut self)
fn assign_random(
&mut self,
bit_count: usize,
random_number_generator: &mut impl RngExt,
)where
BorrowedSelf: BitLength,
§impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
fn assign(&mut self, other: &Other)
fn bitxor_assign(&mut self, other: &Other)
fn bitand_assign(&mut self, other: &Other)
fn bitor_assign(&mut self, other: &Other)
§impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
§impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
fn index(&self, index: usize) -> bool
fn weight(&self) -> usize
fn parity(&self) -> bool
fn is_zero(&self) -> bool
fn is_unit(&self, index: usize) -> bool
fn support<'a>(&'a self) -> impl SortedIteratorwhere
BorrowedSelf: 'a,
fn max_support(&self) -> Option<usize>
fn min_support(&self) -> Option<usize>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);