snarkvm_console_account

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<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 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<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<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<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§