Struct midenc_hir::ReplaceBuilder

source ·
pub struct ReplaceBuilder<'f> { /* private fields */ }
Expand description

Instruction builder that replaces an existing instruction.

The inserted instruction will have the same Inst number as the old one.

If the old instruction still has result values attached, it is assumed that the new instruction produces the same number and types of results. The old result values are preserved. If the replacement instruction format does not support multiple results, the builder panics. It is a bug to leave result values dangling.

Implementations§

source§

impl<'f> ReplaceBuilder<'f>

source

pub fn new(dfg: &'f mut DataFlowGraph, inst: Inst) -> Self

Create a ReplaceBuilder that will overwrite inst.

Trait Implementations§

source§

impl<'f> InstBuilderBase<'f> for ReplaceBuilder<'f>

source§

fn data_flow_graph(&self) -> &DataFlowGraph

Get a reference to the underlying DataFlowGraph for this builder
source§

fn data_flow_graph_mut(&mut self) -> &mut DataFlowGraph

Get a mutable reference to the underlying DataFlowGraph for this builder
source§

fn insertion_point(&self) -> InsertionPoint

Return the insertion point of this builder
source§

fn build( self, data: Instruction, ctrl_typevar: Type, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

Build the given instruction, returing it’s handle and the inner DataFlowGraph
source§

fn ins<'a, 'b: 'a>(&'b mut self) -> DefaultInstBuilder<'a>

Get a default instruction builder using the dataflow graph and insertion point of the current builder

Auto Trait Implementations§

§

impl<'f> Freeze for ReplaceBuilder<'f>

§

impl<'f> !RefUnwindSafe for ReplaceBuilder<'f>

§

impl<'f> !Send for ReplaceBuilder<'f>

§

impl<'f> !Sync for ReplaceBuilder<'f>

§

impl<'f> Unpin for ReplaceBuilder<'f>

§

impl<'f> !UnwindSafe for ReplaceBuilder<'f>

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
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
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'f, T> InstBuilder<'f> for T
where T: InstBuilderBase<'f>,

source§

fn assert(self, value: Value, span: SourceSpan) -> Inst

source§

fn assert_with_error(self, value: Value, code: u32, span: SourceSpan) -> Inst

source§

fn assertz(self, value: Value, span: SourceSpan) -> Inst

source§

fn assertz_with_error(self, value: Value, code: u32, span: SourceSpan) -> Inst

source§

fn assert_eq(self, lhs: Value, rhs: Value, span: SourceSpan) -> Inst

source§

fn assert_eq_imm(self, lhs: Immediate, rhs: Value, span: SourceSpan) -> Inst

source§

fn i1(self, imm: bool, span: SourceSpan) -> Value

source§

fn u8(self, imm: u8, span: SourceSpan) -> Value

source§

fn i8(self, imm: i8, span: SourceSpan) -> Value

source§

fn u16(self, imm: u16, span: SourceSpan) -> Value

source§

fn i16(self, imm: i16, span: SourceSpan) -> Value

source§

fn u32(self, imm: u32, span: SourceSpan) -> Value

source§

fn i32(self, imm: i32, span: SourceSpan) -> Value

source§

fn u64(self, imm: u64, span: SourceSpan) -> Value

source§

fn i64(self, imm: i64, span: SourceSpan) -> Value

source§

fn u128(self, imm: u128, span: SourceSpan) -> Value

source§

fn i128(self, imm: i128, span: SourceSpan) -> Value

source§

fn felt(self, i: Felt, span: SourceSpan) -> Value

source§

fn f64(self, f: f64, span: SourceSpan) -> Value

source§

fn character(self, c: char, span: SourceSpan) -> Value

source§

fn alloca(self, ty: Type, span: SourceSpan) -> Value

source§

fn mem_grow(self, num_pages: Value, span: SourceSpan) -> Value

Grow the global heap by num_pages pages, in 64kb units. Read more
source§

fn mem_size(self, span: SourceSpan) -> Value

Return the size of the global heap in pages, where each page is 64kb.
source§

fn symbol<S: AsRef<str>>(self, name: S, span: SourceSpan) -> GlobalValue

Get a GlobalValue which represents the address of a global variable whose symbol is name Read more
source§

fn symbol_relative<S: AsRef<str>>( self, name: S, offset: i32, span: SourceSpan, ) -> GlobalValue

Same semantics as symbol, but applies a constant offset to the address of the given symbol. Read more
source§

fn symbol_addr<S: AsRef<str>>( self, name: S, ty: Type, span: SourceSpan, ) -> Value

Get the address of a global variable whose symbol is name Read more
source§

fn symbol_relative_addr<S: AsRef<str>>( self, name: S, offset: i32, ty: Type, span: SourceSpan, ) -> Value

Same semantics as symbol_addr, but applies a constant offset to the address of the given symbol. Read more
source§

fn load_symbol<S: AsRef<str>>( self, name: S, ty: Type, span: SourceSpan, ) -> Value

Loads a value of type ty from the global variable whose symbol is name. Read more
source§

fn load_symbol_relative<S: AsRef<str>>( self, name: S, ty: Type, offset: i32, span: SourceSpan, ) -> Value

Same semantics as load_symbol, but a constant offset is applied to the address before issuing the load.
source§

fn load_global(self, addr: GlobalValue, ty: Type, span: SourceSpan) -> Value

Loads a value of type ty from the address represented by addr Read more
source§

fn load_global_relative( self, base: GlobalValue, ty: Type, offset: i32, span: SourceSpan, ) -> Value

Same semantics as load_global_relative, but a constant offset is applied to the address before issuing the load.
source§

fn global_addr_offset( self, base: GlobalValue, offset: i32, unit_ty: Type, span: SourceSpan, ) -> Value

Computes an address relative to the pointer produced by base, by applying an offset given by multiplying offset * the size in bytes of unit_ty. Read more
source§

fn load(self, addr: Value, span: SourceSpan) -> Value

Loads a value of the type pointed to by the given pointer, on to the stack Read more
source§

fn load_local(self, local: LocalId, span: SourceSpan) -> Value

Loads a value from the given temporary (local variable), of the type associated with that local.
source§

fn store(self, ptr: Value, value: Value, span: SourceSpan) -> Inst

Stores value to the address given by ptr Read more
source§

fn store_local(self, local: LocalId, value: Value, span: SourceSpan) -> Inst

Stores value to the given temporary (local variable). Read more
source§

fn memset( self, dst: Value, count: Value, value: Value, span: SourceSpan, ) -> Inst

Writes count copies of value to memory starting at address dst. Read more
source§

fn memcpy(self, src: Value, dst: Value, count: Value, span: SourceSpan) -> Inst

Copies count values from the memory at address src, to the memory at address dst. Read more
source§

fn ptrtoint(self, arg: Value, ty: Type, span: SourceSpan) -> Value

This is a cast operation that permits performing arithmetic on pointer values by casting a pointer to a specified integral type.
source§

fn inttoptr(self, arg: Value, ty: Type, span: SourceSpan) -> Value

This is the inverse of ptrtoint, used to recover a pointer that was previously cast to an integer type. It may also be used to cast arbitrary integer values to pointers. Read more
source§

fn getelementptr(self, ptr: Value, indices: &[usize], span: SourceSpan) -> Value

This is an intrinsic which derives a new pointer from an existing pointer to an aggregate. Read more
source§

fn bitcast(self, arg: Value, ty: Type, span: SourceSpan) -> Value

Cast arg to a value of type ty Read more
source§

fn cast(self, arg: Value, ty: Type, span: SourceSpan) -> Value

Cast arg to a value of type ty Read more
source§

fn trunc(self, arg: Value, ty: Type, span: SourceSpan) -> Value

Truncates an integral value as necessary to fit in ty. Read more
source§

fn zext(self, arg: Value, ty: Type, span: SourceSpan) -> Value

Extends an integer into a larger integeral type, by zero-extending the value, i.e. the new high-order bits of the resulting value will be all zero. Read more
source§

fn sext(self, arg: Value, ty: Type, span: SourceSpan) -> Value

Extends an integer into a larger integeral type, by sign-extending the value, i.e. the new high-order bits of the resulting value will all match the sign bit. Read more
source§

fn add_checked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn add_unchecked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn add_wrapping(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn add_overflowing(self, lhs: Value, rhs: Value, span: SourceSpan) -> Inst

source§

fn add_imm_checked(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn add_imm_unchecked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn add_imm_wrapping(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn add_imm_overflowing( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Inst

source§

fn sub_checked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn sub_unchecked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn sub_wrapping(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn sub_overflowing(self, lhs: Value, rhs: Value, span: SourceSpan) -> Inst

source§

fn sub_imm_checked(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn sub_imm_unchecked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn sub_imm_wrapping(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn sub_imm_overflowing( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Inst

source§

fn mul_checked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn mul_unchecked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn mul_wrapping(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn mul_overflowing(self, lhs: Value, rhs: Value, span: SourceSpan) -> Inst

source§

fn mul_imm_checked(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn mul_imm_unchecked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn mul_imm_wrapping(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn mul_imm_overflowing( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Inst

source§

fn div_checked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn div_unchecked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn div_imm_checked(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn div_imm_unchecked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn min(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn min_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn max(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn max_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn mod_checked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn mod_unchecked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn mod_imm_checked(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn mod_imm_unchecked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn divmod_checked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn divmod_unchecked(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn divmod_imm_checked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn divmod_imm_unchecked( self, lhs: Value, imm: Immediate, span: SourceSpan, ) -> Value

source§

fn exp(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn exp_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn and(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn and_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn band(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn band_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn or(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn or_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn bor(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn bor_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn xor(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn xor_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn bxor(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn bxor_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn neg(self, rhs: Value, span: SourceSpan) -> Value

source§

fn inv(self, rhs: Value, span: SourceSpan) -> Value

source§

fn incr_checked(self, rhs: Value, span: SourceSpan) -> Value

source§

fn incr_unchecked(self, rhs: Value, span: SourceSpan) -> Value

source§

fn incr_wrapping(self, rhs: Value, span: SourceSpan) -> Value

source§

fn incr_overflowing(self, rhs: Value, span: SourceSpan) -> Inst

source§

fn ilog2(self, rhs: Value, span: SourceSpan) -> Value

source§

fn pow2(self, rhs: Value, span: SourceSpan) -> Value

source§

fn not(self, rhs: Value, span: SourceSpan) -> Value

source§

fn bnot(self, rhs: Value, span: SourceSpan) -> Value

source§

fn popcnt(self, rhs: Value, span: SourceSpan) -> Value

source§

fn clz(self, rhs: Value, span: SourceSpan) -> Value

source§

fn ctz(self, rhs: Value, span: SourceSpan) -> Value

source§

fn clo(self, rhs: Value, span: SourceSpan) -> Value

source§

fn cto(self, rhs: Value, span: SourceSpan) -> Value

source§

fn rotl(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn rotl_imm(self, lhs: Value, shift: u32, span: SourceSpan) -> Value

source§

fn rotr(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn rotr_imm(self, lhs: Value, shift: u32, span: SourceSpan) -> Value

source§

fn shl(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn shl_imm(self, lhs: Value, shift: u32, span: SourceSpan) -> Value

source§

fn shr(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn shr_imm(self, lhs: Value, shift: u32, span: SourceSpan) -> Value

source§

fn eq(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn eq_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn neq(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn neq_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn gt(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn gt_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn gte(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn gte_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn lt(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn lt_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn lte(self, lhs: Value, rhs: Value, span: SourceSpan) -> Value

source§

fn lte_imm(self, lhs: Value, imm: Immediate, span: SourceSpan) -> Value

source§

fn is_odd(self, value: Value, span: SourceSpan) -> Value

source§

fn call(self, callee: FunctionIdent, args: &[Value], span: SourceSpan) -> Inst

source§

fn syscall( self, callee: FunctionIdent, args: &[Value], span: SourceSpan, ) -> Inst

source§

fn select(self, cond: Value, a: Value, b: Value, span: SourceSpan) -> Value

source§

fn br(self, block: Block, args: &[Value], span: SourceSpan) -> Inst

source§

fn cond_br( self, cond: Value, then_dest: Block, then_args: &[Value], else_dest: Block, else_args: &[Value], span: SourceSpan, ) -> Inst

source§

fn switch(self, arg: Value, span: SourceSpan) -> SwitchBuilder<'f, Self>

source§

fn ret(self, returning: Option<Value>, span: SourceSpan) -> Inst

source§

fn ret_imm(self, arg: Immediate, span: SourceSpan) -> Inst

source§

fn unreachable(self, span: SourceSpan) -> Inst

source§

fn inline_asm( self, args: &[Value], results: impl IntoIterator<Item = Type>, span: SourceSpan, ) -> MasmBuilder<Self>

source§

fn CondBr( self, cond: Value, then_dest: Block, then_args: ValueList, else_dest: Block, else_args: ValueList, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Br( self, op: Opcode, ty: Type, destination: Block, args: ValueList, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Switch( self, arg: Value, arms: Vec<SwitchArm>, default: Successor, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Ret(self, args: ValueList, span: SourceSpan) -> (Inst, &'f mut DataFlowGraph)

source§

fn Call( self, op: Opcode, callee: FunctionIdent, args: ValueList, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Binary( self, op: Opcode, ty: Type, lhs: Value, rhs: Value, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn BinaryWithOverflow( self, op: Opcode, ty: Type, lhs: Value, rhs: Value, overflow: Overflow, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn BinaryImm( self, op: Opcode, ty: Type, arg: Value, imm: Immediate, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn BinaryImmWithOverflow( self, op: Opcode, ty: Type, arg: Value, imm: Immediate, overflow: Overflow, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Unary( self, op: Opcode, ty: Type, arg: Value, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn UnaryWithOverflow( self, op: Opcode, ty: Type, arg: Value, overflow: Overflow, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn UnaryImm( self, op: Opcode, ty: Type, imm: Immediate, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn UnaryImmWithOverflow( self, op: Opcode, ty: Type, imm: Immediate, overflow: Overflow, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Test( self, op: Opcode, ret: Type, arg: Value, ty: Type, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn PrimOp( self, op: Opcode, ty: Type, args: ValueList, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn PrimOpImm( self, op: Opcode, ty: Type, imm: Immediate, args: ValueList, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

fn Global( self, global: GlobalValue, ty: Type, span: SourceSpan, ) -> (Inst, &'f mut DataFlowGraph)

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
source§

impl<D> OwoColorize for D

source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more