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 ConsensusVersion

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 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, 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<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.

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§

Source§

impl ToBytes for LiteralType

Source§

impl ToBytes for BigInteger256

Source§

impl ToBytes for BigInteger384

Source§

impl<E> ToBytes for Address<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> ToBytes for Group<E>
where E: Environment,

Source§

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

Source§

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

Source§

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

Source§

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 DynamicFuture<N>

Source§

impl<N: Network> ToBytes for DynamicRecord<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 Record<N, Private>