Skip to main content

ToBytes

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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 VarunaVersion

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 ToBytes for ECDSASignature

Source§

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

Source§

impl ToBytes for RecoveryID

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<C> ToBytes for LabeledCommitment<C>

Source§

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

Source§

impl<E> ToBytes for KZGCommitment<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for KZGProof<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for KZGRandomness<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for UniversalParams<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for VerifierKey<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for BatchLCProof<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for CommitterKey<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for Certificate<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for CircuitVerifyingKey<E>
where E: PairingEngine,

Source§

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

Source§

impl<E> ToBytes for Proof<E>
where E: PairingEngine,

Source§

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

Source§

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

Source§

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

Writes the boolean to a buffer.

Source§

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

Source§

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

Writes the field to a buffer.

Source§

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

Source§

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

Writes the group to a buffer.

Source§

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

Source§

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

Writes the scalar to a buffer.

Source§

impl<E> ToBytes for PowersOfBetaG<E>
where E: PairingEngine,

Source§

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

Writes the powers to the buffer.

Source§

impl<E> ToBytes for PowersOfG<E>
where E: PairingEngine,

Source§

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

Writes the powers to the buffer.

Source§

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

Source§

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

Writes the integer to a buffer.

Source§

impl<E, SM> ToBytes for CircuitProvingKey<E, SM>
where E: PairingEngine, SM: SNARKMode,

Source§

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

Source§

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

Source§

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

Writes the Merkle path to a buffer.

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<PH, const DEPTH: u8, const ARITY: u8> ToBytes for KaryMerklePath<PH, DEPTH, ARITY>
where PH: PathHash,

Source§

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

Writes the Merkle path to a buffer.

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,

Source§

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

Source§

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

Writes self to writer in little-endian order.

Implementors§

Source§

impl ToBytes for ConsensusVersion

Source§

impl ToBytes for BigInteger256

Source§

impl ToBytes for BigInteger384

Source§

impl<F: FieldTrait, const PREFIX: u16> ToBytes for AleoID<F, PREFIX>

Source§

impl<T: Clone + Debug + ToBytes + FromBytes + PartialEq + Eq + Sync + Send, const PREFIX: u32> ToBytes for AleoObject<T, PREFIX>