Skip to main content

Unit

Trait Unit 

Source
pub trait Unit: Clone + Sized {
    const ZERO: Self;
}
Expand description

A trait denoting the requirements for the elements of the alphabet.

use spongefish::Unit;

#[derive(Clone, Debug, Unit, PartialEq, Eq)]
pub struct Rgb(pub u8, pub u8, pub u8);

assert_eq!(Rgb::ZERO, Rgb(0, 0, 0))

Required Associated Constants§

Source

const ZERO: Self

The zero element.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Unit for u8

Source§

const ZERO: Self = 0

Source§

impl Unit for u32

Source§

const ZERO: Self = 0

Source§

impl Unit for u64

Source§

const ZERO: Self = 0

Source§

impl Unit for u128

Source§

const ZERO: Self = 0

Source§

impl Unit for usize

Source§

const ZERO: Self = 0

Source§

impl Unit for Scalar

Available on crate feature bls12_381 only.
Source§

const ZERO: Self

Source§

impl Unit for Scalar

Available on crate feature curve25519-dalek only.
Source§

const ZERO: Self = Self::ZERO

Source§

impl Unit for Scalar

Available on crate feature k256 only.
Source§

const ZERO: Self = <Self as Field>::ZERO

Source§

impl Unit for Mersenne31

Available on crate feature p3-mersenne-31 only.
Source§

const ZERO: Self = MERSENNE31_ZERO

Source§

impl Unit for Scalar

Available on crate feature p256 only.
Source§

const ZERO: Self = Self::ZERO

Source§

impl Unit for BabyBear

Available on crate feature p3-baby-bear only.
Source§

const ZERO: Self = BABYBEAR_ZERO

Source§

impl Unit for KoalaBear

Available on crate feature p3-koala-bear only.
Source§

const ZERO: Self = KOALABEAR_ZERO

Source§

impl Unit for BabyBearElem

Available on crate feature risc0-zkp only.
Source§

const ZERO: Self

Source§

impl<C: FpConfig<N>, const N: usize> Unit for Fp<C, N>

Available on crate feature ark-ff only.
Source§

const ZERO: Self = C::ZERO

Source§

impl<P: SmallFpConfig> Unit for SmallFp<P>

Available on crate feature ark-ff only.
Source§

const ZERO: Self = P::ZERO

Implementors§