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 Twhere T: 'a + ToBytes,

source§

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

§

impl<C> ToBytes for LabeledCommitment<C>where C: CanonicalSerialize + ToBytes,

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

Writes the powers to the buffer.

§

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

§

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

Writes the powers to the buffer.

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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<F, const PREFIX: u16> ToBytes for AleoID<F, PREFIX>where F: FieldTrait,

source§

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

Writes the data 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<N> ToBytes for ComputeKey<N>where N: Network,

source§

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

Writes an account compute key to a buffer.

source§

impl<N> ToBytes for GraphKey<N>where N: Network,

source§

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

Writes an account graph key to a buffer.

source§

impl<N> ToBytes for PrivateKey<N>where N: Network,

source§

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

Writes an account private key to a buffer.

source§

impl<N> ToBytes for ViewKey<N>where N: Network,

source§

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

Writes an account view key to a buffer.

§

impl<P> ToBytes for Affine<P>where P: TwistedEdwardsParameters,

§

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

§

impl<P> ToBytes for Affine<P>where P: ShortWeierstrassParameters,

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<P> ToBytes for Projective<P>where P: TwistedEdwardsParameters,

§

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

§

impl<P> ToBytes for Projective<P>where P: ShortWeierstrassParameters,

§

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<T, const PREFIX: u32> ToBytes for AleoObject<T, PREFIX>where T: Clone + Debug + ToBytes + FromBytes + PartialEq + Eq + Sync + Send,

source§

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

Writes the data to a buffer.

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 LiteralType

source§

impl ToBytes for BigInteger256

source§

impl ToBytes for BigInteger384

§

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

§

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

§

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

§

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

§

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

§

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

§

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

source§

impl<N> ToBytes for Signature<N>where N: Network,

source§

impl<N: Network> ToBytes for Access<N>

source§

impl<N: Network> ToBytes for Argument<N>

source§

impl<N: Network> ToBytes for EntryType<N>

source§

impl<N: Network> ToBytes for FinalizeType<N>

source§

impl<N: Network> ToBytes for InputID<N>

source§

impl<N: Network> ToBytes for Literal<N>

source§

impl<N: Network> ToBytes for Plaintext<N>

source§

impl<N: Network> ToBytes for PlaintextType<N>

source§

impl<N: Network> ToBytes for Register<N>

source§

impl<N: Network> ToBytes for RegisterType<N>

source§

impl<N: Network> ToBytes for Value<N>

source§

impl<N: Network> ToBytes for ValueType<N>

source§

impl<N: Network> ToBytes for HeaderLeaf<N>

source§

impl<N: Network> ToBytes for StatePath<N>

source§

impl<N: Network> ToBytes for TransactionLeaf<N>

source§

impl<N: Network> ToBytes for TransitionLeaf<N>

source§

impl<N: Network> ToBytes for ArrayType<N>

source§

impl<N: Network> ToBytes for Ciphertext<N>

source§

impl<N: Network> ToBytes for Future<N>

source§

impl<N: Network> ToBytes for Identifier<N>

source§

impl<N: Network> ToBytes for Locator<N>

source§

impl<N: Network> ToBytes for ProgramID<N>

source§

impl<N: Network> ToBytes for ProgramOwner<N>

source§

impl<N: Network> ToBytes for RecordType<N>

source§

impl<N: Network> ToBytes for Request<N>

source§

impl<N: Network> ToBytes for StructType<N>

source§

impl<N: Network, Private: Visibility> ToBytes for Entry<N, Private>

source§

impl<N: Network, Private: Visibility> ToBytes for Owner<N, Private>

source§

impl<N: Network, Private: Visibility> ToBytes for Record<N, Private>