Skip to main content

CompileError

Enum CompileError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§module: String

Module definition containing the site.

§local_position: IVec3

Site position within the definition.

§linked_position: IVec3

Site position after module linking.

§signature: String

Missing physical signature.

§

CliffordProxyPinCount

A Clifford proxy received the wrong number of selective-block pins.

Fields

§expected: usize

Required number of pins.

§actual: usize

Supplied number of pins.

§

SelectiveArmSignatureMismatch

The two per-basis arms must present the same output signature.

Fields

§kind: SelectiveKind

Selective block whose arms disagree.

§reason: String

Signature difference found between the arms.

§

InvalidConnectivity

A block’s connected faces are unsupported by fixed-bulk lowering.

Fields

§kind: BlockKind

Block kind being validated.

§connectivity: Connectivity

Unsupported face connectivity.

§

MissingBoundaryBasis

A temporal leaf block has no neighboring boundary basis.

Fields

§kind: BlockKind

Block kind requiring the basis.

§

SpatialPortNeighborNotCube

A spatial port is connected to a block that cannot supply cube geometry.

Fields

§port: IVec3

Spatial port position.

§neighbor: IVec3

Connected non-cube position.

§

SpatialPortCubeInferenceFailed

A spatial port’s virtual cube kind could not be inferred.

Fields

§port: IVec3

Spatial port position.

§

TallSpatialPortUnsupported

A spatial port borders a cube taller than the substitution supports.

Fields

§port: IVec3

Spatial port position.

§height: CubeHeight

Unsupported neighboring cube height.

§

MultiplexOutputCoordinateUnavailable

No unused coordinate is available for a multiplexed logical output.

Fields

§port: IVec3

Multiplex port position.

§

SpatialHadamardUnsupportedEndpoint

A spatial Hadamard wall endpoint is not a cube.

Fields

§pos: IVec3

Unsupported endpoint position.

§

MixedSpatialHadamardUnsupported

One spatial component contains Hadamard walls on both spatial axes.

Fields

§pos: IVec3

Position identifying the mixed-axis component.

§

CubeHeightTooShort

A cube height resolves to fewer than two syndrome rounds.

Fields

§pos: IVec3

Cube position.

§height: CubeHeight

Authored symbolic height.

§distance: u32

Code distance used to resolve the height.

§rounds: i64

Resolved syndrome-round count.

§

BlockLayoutCoordinateOverflow

A block position cannot be mapped into the signed physical coordinate range.

Fields

§block_xy: IVec2

Block’s spatial coordinate.

§distance: u32

Code distance scaling the coordinate.

§

OverlappingNodeQubit

Two same-layer nodes own the same physical qubit.

Fields

§first: BloqNodeId

First conflicting node.

§second: BloqNodeId

Second conflicting node.

§qubit: IVec2

Shared physical coordinate.

§

PatchRotationConstructionFailed

Patch-rotation circuit construction failed.

Fields

§reason: String

Construction failure detail.

§

NodeFlowCompositionFailed

Stabilizer-flow composition failed for one physical node.

Fields

§layer: i64

Physical layer containing the node.

§members: Vec<IVec3>

Source blocks merged into the node.

§source: FlowError

Underlying flow-composition failure.

§

DetectorFlowCompositionFailed

Program detector-flow composition failed.

Fields

§source: FlowError

Underlying flow-composition failure.

§

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: IVec3

T-block position.

§

WalkingConstruction(WalkError)

Walking-block circuit construction failed.

§

ObservableMissingGatewayEntry

Observable lowering found no gateway entry for a local stabilizer.

Fields

§block_pos: IVec3

Source block position.

§observable_index: u32

Observable being lowered.

§local_stabilizer: String

Diagnostic description of the missing local gateway key.

§

ObservableSeamMismatch

A logical boundary operator disagrees across a temporal seam.

Fields

§observable_index: u32

Observable being lowered.

§lower: IVec3

Lower seam endpoint.

§upper: IVec3

Upper seam endpoint.

§

BranchAssembly

Continuing-branch assembly cannot be scheduled.

Fields

§reason: String

Scheduling failure detail.

§

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.

Fields

§coordinate: IVec2

Boundary coordinate before rebasing.

§offset: IVec2

Physical patch offset.

§

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

Source

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.

Source

pub fn is_cancelled(&self) -> bool

Whether the caller cancelled this computation, including a forwarded graph-analysis failure.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CompileError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CompileError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BlockGraphError> for CompileError

Source§

fn from(source: BlockGraphError) -> Self

Converts to this type from the input type.
Source§

impl From<BloqValidationError> for CompileError

Source§

fn from(source: BloqValidationError) -> Self

Converts to this type from the input type.
Source§

impl From<BooleanResourceError> for CompileError

Source§

fn from(source: BooleanResourceError) -> Self

Converts to this type from the input type.
Source§

impl From<Box<ModuleError>> for CompileError

Source§

fn from(source: Box<ModuleError>) -> Self

Converts to this type from the input type.
Source§

impl From<CircuitError> for CompileError

Source§

fn from(source: CircuitError) -> Self

Converts to this type from the input type.
Source§

impl From<ComputationCancelled> for CompileError

Source§

fn from(source: ComputationCancelled) -> Self

Converts to this type from the input type.
Source§

impl From<CoordinateOverflowError> for CompileError

Source§

fn from(source: CoordinateOverflowError) -> Self

Converts to this type from the input type.
Source§

impl From<EditError> for CompileError

Source§

fn from(source: EditError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidDistance> for CompileError

Source§

fn from(err: InvalidDistance) -> Self

Converts to this type from the input type.
Source§

impl From<ModuleCertificationError> for CompileError

Source§

fn from(source: ModuleCertificationError) -> Self

Converts to this type from the input type.
Source§

impl From<ModuleError> for CompileError

Source§

fn from(error: ModuleError) -> Self

Converts to this type from the input type.
Source§

impl From<OutputCorrectionError> for CompileError

Source§

fn from(source: OutputCorrectionError) -> Self

Converts to this type from the input type.
Source§

impl From<RuntimeBasisError> for CompileError

Source§

fn from(source: RuntimeBasisError) -> Self

Converts to this type from the input type.
Source§

impl From<SymbolicBasisError> for CompileError

Source§

fn from(source: SymbolicBasisError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
where T: BorrowMut<BorrowedSelf>, BorrowedSelf: BitwiseMut + ?Sized,

§

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
where Bits: BorrowMut<BorrowedSelf> + ?Sized, Other: Borrow<BorrowedOther> + ?Sized, BorrowedSelf: Bitwise + BitwisePairMut<BorrowedOther> + ?Sized, BorrowedOther: Bitwise + ?Sized,

§

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
where T: Borrow<BorrowedSelf> + ?Sized, Other: Borrow<BorrowedOther> + ?Sized, BorrowedSelf: Bitwise + BitwisePair<BorrowedOther> + ?Sized, BorrowedOther: Bitwise + ?Sized,

§

fn dot(&self, other: &Other) -> bool

§

fn and_weight(&self, other: &Other) -> usize

§

fn or_weight(&self, other: &Other) -> usize

§

fn xor_weight(&self, other: &Other) -> usize

§

impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
where T: Borrow<BorrowedSelf>, BorrowedSelf: Bitwise + ?Sized,

§

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 SortedIterator
where BorrowedSelf: 'a,

§

fn max_support(&self) -> Option<usize>

§

fn min_support(&self) -> Option<usize>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Fmt for T
where T: Display,

§

fn fg<C>(self, color: C) -> Foreground<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified foreground colour.
§

fn bg<C>(self, color: C) -> Background<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified background colour.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 T
where T: 'src,

§

type Proj<U: 'src> = U

§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

§

impl<T> Paint for T
where T: ?Sized,

§

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 primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

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>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

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 bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

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 mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

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.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

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);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SpanWrap<S> for T
where S: WrappingSpan<T>,

§

fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned

Invokes [WrappingSpan::make_wrapped] to wrap an AST node in a span.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V