referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::arithmetic::traits::One

source ·
pub trait One: Sized + Mul<Output = Self> {
    // Required method
    fn one() -> Self;

    // Provided methods
    fn set_one(&mut self) { ... }
    fn is_one(&self) -> bool
       where Self: PartialEq { ... }
}
Expand description

Defines a multiplicative identity element for Self.

§Laws

a * 1 = a       ∀ a ∈ Self
1 * a = a       ∀ a ∈ Self

Required Methods§

source

fn one() -> Self

Returns the multiplicative identity element of Self, 1.

§Purity

This function should return the same result at all times regardless of external mutable state, for example values stored in TLS or in static muts.

Provided Methods§

source

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.

source

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity.

For performance reasons, it’s best to implement this manually. After a semver bump, this method will be required, and the where Self: PartialEq bound will be removed.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl One for f32

source§

fn one() -> f32

source§

fn is_one(&self) -> bool

source§

impl One for f64

source§

fn one() -> f64

source§

fn is_one(&self) -> bool

source§

impl One for i8

source§

fn one() -> i8

source§

fn is_one(&self) -> bool

source§

impl One for i16

source§

fn one() -> i16

source§

fn is_one(&self) -> bool

source§

impl One for i32

source§

fn one() -> i32

source§

fn is_one(&self) -> bool

source§

impl One for i64

source§

fn one() -> i64

source§

fn is_one(&self) -> bool

source§

impl One for i128

source§

fn one() -> i128

source§

fn is_one(&self) -> bool

source§

impl One for isize

source§

fn one() -> isize

source§

fn is_one(&self) -> bool

source§

impl One for u8

source§

fn one() -> u8

source§

fn is_one(&self) -> bool

source§

impl One for u16

source§

fn one() -> u16

source§

fn is_one(&self) -> bool

source§

impl One for u32

source§

fn one() -> u32

source§

fn is_one(&self) -> bool

source§

impl One for u64

source§

fn one() -> u64

source§

fn is_one(&self) -> bool

source§

impl One for u128

source§

fn one() -> u128

source§

fn is_one(&self) -> bool

source§

impl One for usize

source§

fn one() -> usize

source§

fn is_one(&self) -> bool

source§

impl One for BigInt

source§

fn one() -> BigInt

source§

fn set_one(&mut self)

source§

fn is_one(&self) -> bool

source§

impl One for BigUint

source§

fn one() -> BigUint

source§

fn set_one(&mut self)

source§

fn is_one(&self) -> bool

§

impl One for AutoSimd<[f32; 2]>

§

fn one() -> AutoSimd<[f32; 2]>

§

impl One for AutoSimd<[f32; 4]>

§

fn one() -> AutoSimd<[f32; 4]>

§

impl One for AutoSimd<[f32; 8]>

§

fn one() -> AutoSimd<[f32; 8]>

§

impl One for AutoSimd<[f32; 16]>

§

fn one() -> AutoSimd<[f32; 16]>

§

impl One for AutoSimd<[f64; 2]>

§

fn one() -> AutoSimd<[f64; 2]>

§

impl One for AutoSimd<[f64; 4]>

§

fn one() -> AutoSimd<[f64; 4]>

§

impl One for AutoSimd<[f64; 8]>

§

fn one() -> AutoSimd<[f64; 8]>

§

impl One for AutoSimd<[i8; 2]>

§

fn one() -> AutoSimd<[i8; 2]>

§

impl One for AutoSimd<[i8; 4]>

§

fn one() -> AutoSimd<[i8; 4]>

§

impl One for AutoSimd<[i8; 8]>

§

fn one() -> AutoSimd<[i8; 8]>

§

impl One for AutoSimd<[i8; 16]>

§

fn one() -> AutoSimd<[i8; 16]>

§

impl One for AutoSimd<[i8; 32]>

§

fn one() -> AutoSimd<[i8; 32]>

§

impl One for AutoSimd<[i16; 2]>

§

fn one() -> AutoSimd<[i16; 2]>

§

impl One for AutoSimd<[i16; 4]>

§

fn one() -> AutoSimd<[i16; 4]>

§

impl One for AutoSimd<[i16; 8]>

§

fn one() -> AutoSimd<[i16; 8]>

§

impl One for AutoSimd<[i16; 16]>

§

fn one() -> AutoSimd<[i16; 16]>

§

impl One for AutoSimd<[i16; 32]>

§

fn one() -> AutoSimd<[i16; 32]>

§

impl One for AutoSimd<[i32; 2]>

§

fn one() -> AutoSimd<[i32; 2]>

§

impl One for AutoSimd<[i32; 4]>

§

fn one() -> AutoSimd<[i32; 4]>

§

impl One for AutoSimd<[i32; 8]>

§

fn one() -> AutoSimd<[i32; 8]>

§

impl One for AutoSimd<[i32; 16]>

§

fn one() -> AutoSimd<[i32; 16]>

§

impl One for AutoSimd<[i64; 2]>

§

fn one() -> AutoSimd<[i64; 2]>

§

impl One for AutoSimd<[i64; 4]>

§

fn one() -> AutoSimd<[i64; 4]>

§

impl One for AutoSimd<[i64; 8]>

§

fn one() -> AutoSimd<[i64; 8]>

§

impl One for AutoSimd<[i128; 1]>

§

fn one() -> AutoSimd<[i128; 1]>

§

impl One for AutoSimd<[i128; 2]>

§

fn one() -> AutoSimd<[i128; 2]>

§

impl One for AutoSimd<[i128; 4]>

§

fn one() -> AutoSimd<[i128; 4]>

§

impl One for AutoSimd<[isize; 2]>

§

fn one() -> AutoSimd<[isize; 2]>

§

impl One for AutoSimd<[isize; 4]>

§

fn one() -> AutoSimd<[isize; 4]>

§

impl One for AutoSimd<[isize; 8]>

§

fn one() -> AutoSimd<[isize; 8]>

§

impl One for AutoSimd<[u8; 2]>

§

fn one() -> AutoSimd<[u8; 2]>

§

impl One for AutoSimd<[u8; 4]>

§

fn one() -> AutoSimd<[u8; 4]>

§

impl One for AutoSimd<[u8; 8]>

§

fn one() -> AutoSimd<[u8; 8]>

§

impl One for AutoSimd<[u8; 16]>

§

fn one() -> AutoSimd<[u8; 16]>

§

impl One for AutoSimd<[u8; 32]>

§

fn one() -> AutoSimd<[u8; 32]>

§

impl One for AutoSimd<[u16; 2]>

§

fn one() -> AutoSimd<[u16; 2]>

§

impl One for AutoSimd<[u16; 4]>

§

fn one() -> AutoSimd<[u16; 4]>

§

impl One for AutoSimd<[u16; 8]>

§

fn one() -> AutoSimd<[u16; 8]>

§

impl One for AutoSimd<[u16; 16]>

§

fn one() -> AutoSimd<[u16; 16]>

§

impl One for AutoSimd<[u16; 32]>

§

fn one() -> AutoSimd<[u16; 32]>

§

impl One for AutoSimd<[u32; 2]>

§

fn one() -> AutoSimd<[u32; 2]>

§

impl One for AutoSimd<[u32; 4]>

§

fn one() -> AutoSimd<[u32; 4]>

§

impl One for AutoSimd<[u32; 8]>

§

fn one() -> AutoSimd<[u32; 8]>

§

impl One for AutoSimd<[u32; 16]>

§

fn one() -> AutoSimd<[u32; 16]>

§

impl One for AutoSimd<[u64; 2]>

§

fn one() -> AutoSimd<[u64; 2]>

§

impl One for AutoSimd<[u64; 4]>

§

fn one() -> AutoSimd<[u64; 4]>

§

impl One for AutoSimd<[u64; 8]>

§

fn one() -> AutoSimd<[u64; 8]>

§

impl One for AutoSimd<[u128; 1]>

§

fn one() -> AutoSimd<[u128; 1]>

§

impl One for AutoSimd<[u128; 2]>

§

fn one() -> AutoSimd<[u128; 2]>

§

impl One for AutoSimd<[u128; 4]>

§

fn one() -> AutoSimd<[u128; 4]>

§

impl One for AutoSimd<[usize; 2]>

§

fn one() -> AutoSimd<[usize; 2]>

§

impl One for AutoSimd<[usize; 4]>

§

fn one() -> AutoSimd<[usize; 4]>

§

impl One for AutoSimd<[usize; 8]>

§

fn one() -> AutoSimd<[usize; 8]>

§

impl One for U128

§

fn one() -> U128

§

impl One for U128

§

fn one() -> U128

§

impl One for U256

§

fn one() -> U256

§

impl One for U512

§

fn one() -> U512

§

impl One for WideF32x4

§

fn one() -> WideF32x4

§

impl One for WideF32x8

§

fn one() -> WideF32x8

§

impl One for WideF64x4

§

fn one() -> WideF64x4

§

impl<P> One for CubicExtField<P>
where P: CubicExtConfig,

§

fn one() -> CubicExtField<P>

§

fn is_one(&self) -> bool

§

impl<P> One for QuadExtField<P>
where P: QuadExtConfig,

§

fn one() -> QuadExtField<P>

§

fn is_one(&self) -> bool

§

impl<P, const N: usize> One for Fp<P, N>
where P: FpConfig<N>,

§

fn one() -> Fp<P, N>

§

fn is_one(&self) -> bool

source§

impl<T> One for Wrapping<T>
where T: One, Wrapping<T>: Mul<Output = Wrapping<T>>,

source§

fn set_one(&mut self)

source§

fn one() -> Wrapping<T>

source§

impl<T> One for Unit<DualQuaternion<T>>
where T: SimdRealField, <T as SimdValue>::Element: SimdRealField,

source§

impl<T> One for Unit<Quaternion<T>>
where T: SimdRealField, <T as SimdValue>::Element: SimdRealField,

source§

impl<T> One for Unit<Complex<T>>
where T: SimdRealField, <T as SimdValue>::Element: SimdRealField,

source§

impl<T> One for DualQuaternion<T>
where T: SimdRealField, <T as SimdValue>::Element: SimdRealField,

source§

impl<T> One for Quaternion<T>
where T: SimdRealField, <T as SimdValue>::Element: SimdRealField,

source§

impl<T> One for Complex<T>
where T: Clone + Num,

source§

fn one() -> Complex<T>

source§

fn is_one(&self) -> bool

source§

fn set_one(&mut self)

source§

impl<T> One for Ratio<T>
where T: Clone + Integer,

source§

fn one() -> Ratio<T>

source§

fn is_one(&self) -> bool

source§

fn set_one(&mut self)

source§

impl<T, C, const D: usize> One for Transform<T, C, D>
where T: RealField, C: TCategory, Const<D>: DimNameAdd<Const<1>>, DefaultAllocator: Allocator<T, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>,

source§

fn one() -> Transform<T, C, D>

Creates a new identity transform.

source§

impl<T, D> One for Matrix<T, D, D, <DefaultAllocator as Allocator<T, D, D>>::Buffer>
where D: DimName, T: Scalar + Zero + One + ClosedMul + ClosedAdd, DefaultAllocator: Allocator<T, D, D>,

source§

fn one() -> Matrix<T, D, D, <DefaultAllocator as Allocator<T, D, D>>::Buffer>

§

impl<T, D> One for TypeWithDefault<T, D>
where T: One, D: Get<T>,

§

fn one() -> TypeWithDefault<T, D>

source§

impl<T, R, const D: usize> One for Isometry<T, R, D>
where T: SimdRealField, R: AbstractRotation<T, D>, <T as SimdValue>::Element: SimdRealField,

source§

fn one() -> Isometry<T, R, D>

Creates a new identity isometry.

source§

impl<T, R, const D: usize> One for Similarity<T, R, D>
where T: SimdRealField, <T as SimdValue>::Element: SimdRealField, R: AbstractRotation<T, D>,

source§

fn one() -> Similarity<T, R, D>

Creates a new identity similarity.

source§

impl<T, const D: usize> One for Rotation<T, D>
where T: Scalar + Zero + One + ClosedAdd + ClosedMul,

source§

fn one() -> Rotation<T, D>

source§

impl<T, const D: usize> One for Scale<T, D>
where T: Scalar + One + ClosedMul,

source§

fn one() -> Scale<T, D>

source§

impl<T, const D: usize> One for Translation<T, D>
where T: Scalar + Zero + ClosedAdd,

source§

fn one() -> Translation<T, D>

Implementors§

§

impl One for polkadot_sdk_frame::hashing::U256

§

impl One for polkadot_sdk_frame::hashing::U512

§

impl One for polkadot_sdk_frame::arithmetic::biguint::BigUint

§

impl One for FixedI64

§

impl One for FixedI128

§

impl One for FixedU64

§

impl One for FixedU128

§

impl One for PerU16

§

impl One for Perbill

§

impl One for Percent

§

impl One for Permill

§

impl One for Perquintill