snarkvm_console_collections::scalar

Trait ToBytes

Source
pub trait ToBytes {
    // Required method
    fn write_le<W>(&self, writer: W) -> Result<(), Error>
       where W: Write,
             Self: Sized;

    // Provided method
    fn to_bytes_le(&self) -> Result<Vec<u8>, Error>
       where Self: Sized { ... }
}

Required Methods§

Source

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write, Self: Sized,

Writes self into writer as little-endian bytes.

Provided Methods§

Source

fn to_bytes_le(&self) -> Result<Vec<u8>, Error>
where Self: Sized,

Returns self as a byte array in little-endian order.

Implementations on Foreign Types§

Source§

impl ToBytes for SocketAddr

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for bool

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for i8

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for i16

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for i32

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for i64

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for i128

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for u8

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for u16

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for u32

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for u64

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for u128

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl ToBytes for ()

Source§

fn write_le<W>(&self, _writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<'a, T> ToBytes for &'a [T]
where T: 'a + ToBytes,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<'a, T> ToBytes for &'a T
where T: 'a + ToBytes,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<L, R> ToBytes for (L, R)
where L: ToBytes, R: ToBytes,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for G1Prepared<P>
where P: Bls12Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for G2Prepared<P>
where P: Bls12Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Affine<P>

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Projective<P>

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Affine<P>

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Projective<P>

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Fp2<P>
where P: Fp2Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Fp6<P>
where P: Fp6Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Fp12<P>
where P: Fp12Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Fp256<P>
where P: Fp256Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<P> ToBytes for Fp384<P>
where P: Fp384Parameters,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<T> ToBytes for Vec<T>
where T: ToBytes,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<const N: usize> ToBytes for [u8; N]

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<const N: usize> ToBytes for [u16; N]

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<const N: usize> ToBytes for [u32; N]

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source§

impl<const N: usize> ToBytes for [u64; N]

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Implementors§

Source§

impl ToBytes for BigInteger256

Source§

impl ToBytes for BigInteger384

Source§

impl<E> ToBytes for Group<E>
where E: Environment,

Source§

impl<E> ToBytes for Scalar<E>
where E: Environment,

Source§

impl<E> ToBytes for Boolean<E>
where E: Environment,

Source§

impl<E> ToBytes for Field<E>
where E: Environment,

Source§

impl<E, I> ToBytes for Integer<E, I>
where E: Environment, I: IntegerType,

Source§

impl<E: Environment, const DEPTH: u8> ToBytes for MerklePath<E, DEPTH>

Source§

impl<PH: PathHash, const DEPTH: u8, const ARITY: u8> ToBytes for KaryMerklePath<PH, DEPTH, ARITY>

Source§

impl<const VARIANT: usize> ToBytes for BooleanHash<VARIANT>