Struct Felt
pub struct Felt(/* private fields */);Expand description
A Felt backed by Plonky3’s Goldilocks field element.
Implementations§
§impl Felt
impl Felt
pub const ZERO: Felt
pub const ONE: Felt
pub const NUM_BYTES: usize = Goldilocks::NUM_BYTES
pub const NUM_BYTES: usize = Goldilocks::NUM_BYTES
The number of bytes which this field element occupies in memory.
pub const fn new(value: u64) -> Felt
pub const fn new(value: u64) -> Felt
Creates a new field element from any u64.
Any u64 value is accepted. No reduction is performed since Goldilocks uses a
non-canonical internal representation.
pub fn from_u8(value: u8) -> Felt
pub fn from_u16(value: u16) -> Felt
pub fn from_u32(value: u32) -> Felt
pub fn exp_const_u64<const POWER: u64>(&self) -> Felt
pub fn exp_const_u64<const POWER: u64>(&self) -> Felt
Exponentiation by a small constant power.
pub fn as_canonical_u64(&self) -> u64
pub fn as_canonical_u64(&self) -> u64
Return the representative of element in canonical form which lies in the range
0 <= x < ORDER.
pub fn as_canonical_u64_ct(&self) -> u64
pub fn as_canonical_u64_ct(&self) -> u64
Constant-time equivalent of as_canonical_u64() using the same reduction logic as
Plonky3’s Goldilocks implementation.
Methods from Deref<Target = Goldilocks>§
pub const TWO_ADIC_GENERATORS: [Goldilocks; 33]
Trait Implementations§
§impl BinomiallyExtendableAlgebra<Felt, 2> for Felt
impl BinomiallyExtendableAlgebra<Felt, 2> for Felt
§fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F)
fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F)
A<X> / (X^D - W). Read more§fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D]
fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D]
A<X> / (X^D - W). Read more§fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D]
fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D]
A<X> / (X^D - W). Read morefn binomial_base_mul(lhs: [Self; D], rhs: Self) -> [Self; D]
§impl BinomiallyExtendableAlgebra<Felt, 5> for Felt
impl BinomiallyExtendableAlgebra<Felt, 5> for Felt
§fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F)
fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F)
A<X> / (X^D - W). Read more§fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D]
fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D]
A<X> / (X^D - W). Read more§fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D]
fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D]
A<X> / (X^D - W). Read morefn binomial_base_mul(lhs: [Self; D], rhs: Self) -> [Self; D]
§impl Deserializable for Felt
impl Deserializable for Felt
§fn read_from<R>(source: &mut R) -> Result<Felt, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<Felt, DeserializationError>where
R: ByteReader,
source, attempts to deserialize these bytes
into Self, and returns the result. Read more§fn min_serialized_size() -> usize
fn min_serialized_size() -> usize
§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
§fn read_from_bytes_with_budget(
bytes: &[u8],
budget: usize,
) -> Result<Self, DeserializationError>
fn read_from_bytes_with_budget( bytes: &[u8], budget: usize, ) -> Result<Self, DeserializationError>
Self from bytes with a byte budget limit. Read more§impl<'de> Deserialize<'de> for Felt
impl<'de> Deserialize<'de> for Felt
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Felt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Felt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Field for Felt
impl Field for Felt
type Packing = Felt
§fn is_zero(&self) -> bool
fn is_zero(&self) -> bool
§fn try_inverse(&self) -> Option<Felt>
fn try_inverse(&self) -> Option<Felt>
§fn is_one(&self) -> bool
fn is_one(&self) -> bool
§fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
§impl HasTwoAdicBinomialExtension<2> for Felt
impl HasTwoAdicBinomialExtension<2> for Felt
§const EXT_TWO_ADICITY: usize
const EXT_TWO_ADICITY: usize
§impl HasTwoAdicBinomialExtension<5> for Felt
impl HasTwoAdicBinomialExtension<5> for Felt
§const EXT_TWO_ADICITY: usize
const EXT_TWO_ADICITY: usize
§impl InjectiveMonomial<7> for Felt
impl InjectiveMonomial<7> for Felt
§fn injective_exp_n(&self) -> Self
fn injective_exp_n(&self) -> Self
x -> x^n for a given n > 1 such that this
map is injective.§impl Ord for Felt
impl Ord for Felt
§impl PartialOrd for Felt
impl PartialOrd for Felt
§impl PermutationMonomial<7> for Felt
impl PermutationMonomial<7> for Felt
§fn injective_exp_root_n(&self) -> Felt
fn injective_exp_root_n(&self) -> Felt
x -> x^K for a given K > 1 such that
x^{NK} = x for all elements x.§impl PrimeCharacteristicRing for Felt
impl PrimeCharacteristicRing for Felt
§type PrimeSubfield = Goldilocks
type PrimeSubfield = Goldilocks
ℤ/p where the characteristic of this ring is p.§fn from_prime_subfield(
f: <Felt as PrimeCharacteristicRing>::PrimeSubfield,
) -> Felt
fn from_prime_subfield( f: <Felt as PrimeCharacteristicRing>::PrimeSubfield, ) -> Felt
§fn mul_2exp_u64(&self, exp: u64) -> Felt
fn mul_2exp_u64(&self, exp: u64) -> Felt
mul_2exp_u64(a, exp) = a * 2^{exp}. Read more§fn div_2exp_u64(&self, exp: u64) -> Felt
fn div_2exp_u64(&self, exp: u64) -> Felt
div_2exp_u64(a, exp) = a/2^exp Read more§fn from_usize(int: usize) -> Self
fn from_usize(int: usize) -> Self
§fn from_isize(int: isize) -> Self
fn from_isize(int: isize) -> Self
§fn xor3(&self, y: &Self, z: &Self) -> Self
fn xor3(&self, y: &Self, z: &Self) -> Self
xor. Read more§fn bool_check(&self) -> Self
fn bool_check(&self) -> Self
x * (x - 1). Read more§fn exp_const_u64<const POWER: u64>(&self) -> Self
fn exp_const_u64<const POWER: u64>(&self) -> Self
§fn exp_power_of_2(&self, power_log: usize) -> Self
fn exp_power_of_2(&self, power_log: usize) -> Self
exp_power_of_2(a, power_log) = a^{2^power_log}. Read more§fn powers(&self) -> Powers<Self>
fn powers(&self) -> Powers<Self>
self: self^0, self^1, self^2, ....§fn shifted_powers(&self, start: Self) -> Powers<Self>
fn shifted_powers(&self, start: Self) -> Powers<Self>
self shifted by start: start, start*self^1, start*self^2, ....§fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self
fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self
§fn sum_array<const N: usize>(input: &[Self]) -> Self
fn sum_array<const N: usize>(input: &[Self]) -> Self
§fn zero_vec(len: usize) -> Vec<Self>
fn zero_vec(len: usize) -> Vec<Self>
len. Many operating systems zero pages
before assigning them to a userspace process. In that case, our process should not need to
write zeros, which would be redundant. However, the compiler may not always recognize this. Read more§impl PrimeField for Felt
impl PrimeField for Felt
§fn as_canonical_biguint(&self) -> BigUint
fn as_canonical_biguint(&self) -> BigUint
value in canonical form
which lies in the range 0 <= x < self.order().§impl PrimeField64 for Felt
impl PrimeField64 for Felt
const ORDER_U64: u64 = <Goldilocks as PrimeField64>::ORDER_U64
§fn as_canonical_u64(&self) -> u64
fn as_canonical_u64(&self) -> u64
value in canonical form
which lies in the range 0 <= x < ORDER_U64.§fn to_unique_u64(&self) -> u64
fn to_unique_u64(&self) -> u64
u64 such that any two field elements
are converted to the same u64 if and only if they represent the same value. Read more§impl QuotientMap<i128> for Felt
impl QuotientMap<i128> for Felt
§fn from_int(int: i128) -> Felt
fn from_int(int: i128) -> Felt
Convert a given i128 integer into an element of the Felt field.
This checks the sign and then makes use of the equivalent method for unsigned integers. This should be avoided in performance critical locations.
§fn from_canonical_checked(int: i128) -> Option<Felt>
fn from_canonical_checked(int: i128) -> Option<Felt>
Convert a given u128 integer into an element of the Felt field.
Returns None if the input does not lie in the range:[-(2^63 - 2^31), 2^63 - 2^31].
§unsafe fn from_canonical_unchecked(int: i128) -> Felt
unsafe fn from_canonical_unchecked(int: i128) -> Felt
Convert a given u128 integer into an element of the Felt field.
§Safety
The input must lie in the range:[1 + 2^32 - 2^64, 2^64 - 1].
§impl QuotientMap<i16> for Felt
impl QuotientMap<i16> for Felt
§fn from_int(int: i16) -> Felt
fn from_int(int: i16) -> Felt
Convert a given i16 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§fn from_canonical_checked(int: i16) -> Option<Felt>
fn from_canonical_checked(int: i16) -> Option<Felt>
Convert a given i16 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§unsafe fn from_canonical_unchecked(int: i16) -> Felt
unsafe fn from_canonical_unchecked(int: i16) -> Felt
Convert a given i16 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§impl QuotientMap<i32> for Felt
impl QuotientMap<i32> for Felt
§fn from_int(int: i32) -> Felt
fn from_int(int: i32) -> Felt
Convert a given i32 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§fn from_canonical_checked(int: i32) -> Option<Felt>
fn from_canonical_checked(int: i32) -> Option<Felt>
Convert a given i32 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§unsafe fn from_canonical_unchecked(int: i32) -> Felt
unsafe fn from_canonical_unchecked(int: i32) -> Felt
Convert a given i32 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§impl QuotientMap<i64> for Felt
impl QuotientMap<i64> for Felt
§fn from_canonical_checked(int: i64) -> Option<Felt>
fn from_canonical_checked(int: i64) -> Option<Felt>
ℤ/p. The input is checked to
ensure it lies within a given range. Read more§unsafe fn from_canonical_unchecked(int: i64) -> Felt
unsafe fn from_canonical_unchecked(int: i64) -> Felt
ℤ/p. The input is guaranteed
to lie within a specific range depending on p. If the input lies outside of this
range, the output is undefined. Read more§impl QuotientMap<i8> for Felt
impl QuotientMap<i8> for Felt
§fn from_int(int: i8) -> Felt
fn from_int(int: i8) -> Felt
Convert a given i8 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§fn from_canonical_checked(int: i8) -> Option<Felt>
fn from_canonical_checked(int: i8) -> Option<Felt>
Convert a given i8 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§unsafe fn from_canonical_unchecked(int: i8) -> Felt
unsafe fn from_canonical_unchecked(int: i8) -> Felt
Convert a given i8 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§impl QuotientMap<u128> for Felt
impl QuotientMap<u128> for Felt
§fn from_int(int: u128) -> Felt
fn from_int(int: u128) -> Felt
Convert a given u128 integer into an element of the Felt field.
Uses a modular reduction to reduce to canonical form. This should be avoided in performance critical locations.
§fn from_canonical_checked(int: u128) -> Option<Felt>
fn from_canonical_checked(int: u128) -> Option<Felt>
Convert a given u128 integer into an element of the Felt field.
Returns None if the input does not lie in the range:[0, 2^64 - 2^32].
§unsafe fn from_canonical_unchecked(int: u128) -> Felt
unsafe fn from_canonical_unchecked(int: u128) -> Felt
Convert a given u128 integer into an element of the Felt field.
§Safety
The input must lie in the range:[0, 2^64 - 1].
§impl QuotientMap<u16> for Felt
impl QuotientMap<u16> for Felt
§fn from_int(int: u16) -> Felt
fn from_int(int: u16) -> Felt
Convert a given u16 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§fn from_canonical_checked(int: u16) -> Option<Felt>
fn from_canonical_checked(int: u16) -> Option<Felt>
Convert a given u16 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§unsafe fn from_canonical_unchecked(int: u16) -> Felt
unsafe fn from_canonical_unchecked(int: u16) -> Felt
Convert a given u16 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§impl QuotientMap<u32> for Felt
impl QuotientMap<u32> for Felt
§fn from_int(int: u32) -> Felt
fn from_int(int: u32) -> Felt
Convert a given u32 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§fn from_canonical_checked(int: u32) -> Option<Felt>
fn from_canonical_checked(int: u32) -> Option<Felt>
Convert a given u32 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§unsafe fn from_canonical_unchecked(int: u32) -> Felt
unsafe fn from_canonical_unchecked(int: u32) -> Felt
Convert a given u32 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§impl QuotientMap<u64> for Felt
impl QuotientMap<u64> for Felt
§fn from_canonical_checked(int: u64) -> Option<Felt>
fn from_canonical_checked(int: u64) -> Option<Felt>
ℤ/p. The input is checked to
ensure it lies within a given range. Read more§unsafe fn from_canonical_unchecked(int: u64) -> Felt
unsafe fn from_canonical_unchecked(int: u64) -> Felt
ℤ/p. The input is guaranteed
to lie within a specific range depending on p. If the input lies outside of this
range, the output is undefined. Read more§impl QuotientMap<u8> for Felt
impl QuotientMap<u8> for Felt
§fn from_int(int: u8) -> Felt
fn from_int(int: u8) -> Felt
Convert a given u8 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§fn from_canonical_checked(int: u8) -> Option<Felt>
fn from_canonical_checked(int: u8) -> Option<Felt>
Convert a given u8 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§unsafe fn from_canonical_unchecked(int: u8) -> Felt
unsafe fn from_canonical_unchecked(int: u8) -> Felt
Convert a given u8 integer into an element of the Felt field.
Due to the integer type, the input value is always canonical.
§impl Randomizable for Felt
impl Randomizable for Felt
§const VALUE_SIZE: usize = 8
const VALUE_SIZE: usize = 8
Self in bytes. Read more§fn from_random_bytes(source: &[u8]) -> Option<Felt>
fn from_random_bytes(source: &[u8]) -> Option<Felt>
Self if the set of bytes forms a valid value, otherwise returns None.§impl RawDataSerializable for Felt
impl RawDataSerializable for Felt
§const NUM_BYTES: usize = 8
const NUM_BYTES: usize = 8
§fn into_bytes(self) -> [u8; 8]
fn into_bytes(self) -> [u8; 8]
§fn into_u32_stream(
input: impl IntoIterator<Item = Felt>,
) -> impl IntoIterator<Item = u32>
fn into_u32_stream( input: impl IntoIterator<Item = Felt>, ) -> impl IntoIterator<Item = u32>
§fn into_u64_stream(
input: impl IntoIterator<Item = Felt>,
) -> impl IntoIterator<Item = u64>
fn into_u64_stream( input: impl IntoIterator<Item = Felt>, ) -> impl IntoIterator<Item = u64>
§fn into_parallel_byte_streams<const N: usize>(
input: impl IntoIterator<Item = [Felt; N]>,
) -> impl IntoIterator<Item = [u8; N]>
fn into_parallel_byte_streams<const N: usize>( input: impl IntoIterator<Item = [Felt; N]>, ) -> impl IntoIterator<Item = [u8; N]>
§fn into_parallel_u32_streams<const N: usize>(
input: impl IntoIterator<Item = [Felt; N]>,
) -> impl IntoIterator<Item = [u32; N]>
fn into_parallel_u32_streams<const N: usize>( input: impl IntoIterator<Item = [Felt; N]>, ) -> impl IntoIterator<Item = [u32; N]>
§fn into_parallel_u64_streams<const N: usize>(
input: impl IntoIterator<Item = [Felt; N]>,
) -> impl IntoIterator<Item = [u64; N]>
fn into_parallel_u64_streams<const N: usize>( input: impl IntoIterator<Item = [Felt; N]>, ) -> impl IntoIterator<Item = [u64; N]>
§fn into_byte_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u8>
fn into_byte_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u8>
§impl Serializable for Felt
impl Serializable for Felt
§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
self into bytes and writes these bytes into the target.§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
§impl Serialize for Felt
impl Serialize for Felt
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl TwoAdicField for Felt
impl TwoAdicField for Felt
§const TWO_ADICITY: usize = <Goldilocks as TwoAdicField>::TWO_ADICITY
const TWO_ADICITY: usize = <Goldilocks as TwoAdicField>::TWO_ADICITY
§fn two_adic_generator(bits: usize) -> Felt
fn two_adic_generator(bits: usize) -> Felt
2^bits.
Assumes bits <= TWO_ADICITY, otherwise the result is undefined.§impl UniformSamplingField for Felt
impl UniformSamplingField for Felt
§const MAX_SINGLE_SAMPLE_BITS: usize = <Goldilocks as UniformSamplingField>::MAX_SINGLE_SAMPLE_BITS
const MAX_SINGLE_SAMPLE_BITS: usize = <Goldilocks as UniformSamplingField>::MAX_SINGLE_SAMPLE_BITS
§const SAMPLING_BITS_M: [u64; 64] = <Goldilocks as UniformSamplingField>::SAMPLING_BITS_M
const SAMPLING_BITS_M: [u64; 64] = <Goldilocks as UniformSamplingField>::SAMPLING_BITS_M
m_k for each k in [0, 31], such that m_k
is a multiple of 2^k and less than P. m_k is defined as: Read moreimpl Copy for Felt
impl Eq for Felt
impl Packable for Felt
Auto Trait Implementations§
impl Freeze for Felt
impl RefUnwindSafe for Felt
impl Send for Felt
impl Sync for Felt
impl Unpin for Felt
impl UnsafeUnpin for Felt
impl UnwindSafe for Felt
Blanket Implementations§
§impl<R> Algebra<R> for Rwhere
R: PrimeCharacteristicRing,
impl<R> Algebra<R> for Rwhere
R: PrimeCharacteristicRing,
§impl<F> BasedVectorSpace<F> for Fwhere
F: PrimeCharacteristicRing,
impl<F> BasedVectorSpace<F> for Fwhere
F: PrimeCharacteristicRing,
§const DIMENSION: usize = 1
const DIMENSION: usize = 1
§fn as_basis_coefficients_slice(&self) -> &[F]
fn as_basis_coefficients_slice(&self) -> &[F]
A and uses this to
map an element of A to a slice of DIMENSION F elements. Read more§fn from_basis_coefficients_fn<Fn>(f: Fn) -> F
fn from_basis_coefficients_fn<Fn>(f: Fn) -> F
A and uses this to
map DIMENSION F elements to an element of A. Similar
to core:array::from_fn, the DIMENSION F elements are
given by Fn(0), ..., Fn(DIMENSION - 1) called in that order. Read more§fn from_basis_coefficients_iter<I>(iter: I) -> Option<F>where
I: ExactSizeIterator<Item = F>,
fn from_basis_coefficients_iter<I>(iter: I) -> Option<F>where
I: ExactSizeIterator<Item = F>,
A and uses this to
map DIMENSION F elements to an element of A. Read more§fn flatten_to_base(vec: Vec<F>) -> Vec<F>
fn flatten_to_base(vec: Vec<F>) -> Vec<F>
§fn reconstitute_from_base(vec: Vec<F>) -> Vec<F>
fn reconstitute_from_base(vec: Vec<F>) -> Vec<F>
§fn from_basis_coefficients_slice(slice: &[F]) -> Option<Self>
fn from_basis_coefficients_slice(slice: &[F]) -> Option<Self>
A and uses this to
map DIMENSION F elements to an element of A. Read more§fn ith_basis_element(i: usize) -> Option<Self>
fn ith_basis_element(i: usize) -> Option<Self>
A, return the i’th basis element. Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<F> ExtensionField<F> for Fwhere
F: Field,
impl<F> ExtensionField<F> for Fwhere
F: Field,
type ExtensionPacking = <F as Field>::Packing
§fn is_in_basefield(&self) -> bool
fn is_in_basefield(&self) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<F> PackedField for Fwhere
F: Field,
impl<F> PackedField for Fwhere
F: Field,
type Scalar = F
§fn packed_powers(base: Self::Scalar) -> Powers<Self>
fn packed_powers(base: Self::Scalar) -> Powers<Self>
base packed into packed field elements. Read more§fn packed_shifted_powers(
base: Self::Scalar,
start: Self::Scalar,
) -> Powers<Self>
fn packed_shifted_powers( base: Self::Scalar, start: Self::Scalar, ) -> Powers<Self>
base multiplied by start and packed into packed field elements. Read more§fn packed_linear_combination<const N: usize>(
coeffs: &[Self::Scalar],
vecs: &[Self],
) -> Self
fn packed_linear_combination<const N: usize>( coeffs: &[Self::Scalar], vecs: &[Self], ) -> Self
§impl<F> PackedFieldPow2 for Fwhere
F: Field,
impl<F> PackedFieldPow2 for Fwhere
F: Field,
§fn interleave(&self, other: F, block_len: usize) -> (F, F)
fn interleave(&self, other: F, block_len: usize) -> (F, F)
block_len elements. Unpack and interleave those
chunks. This is best seen with an example. If we have: Read more§impl<T> PackedValue for Twhere
T: Packable,
impl<T> PackedValue for Twhere
T: Packable,
§fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T
fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T
§fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T
fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T
§fn from_fn<Fn>(f: Fn) -> T
fn from_fn<Fn>(f: Fn) -> T
§fn as_slice(&self) -> &[<T as PackedValue>::Value]
fn as_slice(&self) -> &[<T as PackedValue>::Value]
§fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]
fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]
§fn pack_slice(buf: &[Self::Value]) -> &[Self]
fn pack_slice(buf: &[Self::Value]) -> &[Self]
§fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
§fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]
fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]
§fn pack_maybe_uninit_slice_mut(
buf: &mut [MaybeUninit<Self::Value>],
) -> &mut [MaybeUninit<Self>]
fn pack_maybe_uninit_slice_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> &mut [MaybeUninit<Self>]
§fn pack_slice_with_suffix_mut(
buf: &mut [Self::Value],
) -> (&mut [Self], &mut [Self::Value])
fn pack_slice_with_suffix_mut( buf: &mut [Self::Value], ) -> (&mut [Self], &mut [Self::Value])
§fn pack_maybe_uninit_slice_with_suffix_mut(
buf: &mut [MaybeUninit<Self::Value>],
) -> (&mut [MaybeUninit<Self>], &mut [MaybeUninit<Self::Value>])
fn pack_maybe_uninit_slice_with_suffix_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> (&mut [MaybeUninit<Self>], &mut [MaybeUninit<Self::Value>])
§fn unpack_slice(buf: &[Self]) -> &[Self::Value]
fn unpack_slice(buf: &[Self]) -> &[Self::Value]
§impl<T> PackedValueExt for Twhere
T: PackedValue,
impl<T> PackedValueExt for Twhere
T: PackedValue,
§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);§impl<T> Pointable for T
impl<T> Pointable for T
§impl<F> QuotientMap<isize> for F
impl<F> QuotientMap<isize> for F
§fn from_int(int: isize) -> F
fn from_int(int: isize) -> F
We use the from_int method of the primitive integer type identical to isize on this machine
§fn from_canonical_checked(int: isize) -> Option<F>
fn from_canonical_checked(int: isize) -> Option<F>
We use the from_canonical_checked method of the primitive integer type identical to isize on this machine
§unsafe fn from_canonical_unchecked(int: isize) -> F
unsafe fn from_canonical_unchecked(int: isize) -> F
We use the from_canonical_unchecked method of the primitive integer type identical to isize on this machine
§impl<F> QuotientMap<usize> for F
impl<F> QuotientMap<usize> for F
§fn from_int(int: usize) -> F
fn from_int(int: usize) -> F
We use the from_int method of the primitive integer type identical to usize on this machine
§fn from_canonical_checked(int: usize) -> Option<F>
fn from_canonical_checked(int: usize) -> Option<F>
We use the from_canonical_checked method of the primitive integer type identical to usize on this machine
§unsafe fn from_canonical_unchecked(int: usize) -> F
unsafe fn from_canonical_unchecked(int: usize) -> F
We use the from_canonical_unchecked method of the primitive integer type identical to usize on this machine