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