Skip to main content

Encodable

Trait Encodable 

Source
pub trait Encodable {
    // Required method
    fn encode(&self, out: &mut dyn BufMut);

    // Provided method
    fn length(&self) -> usize { ... }
}

Required Methods§

Source

fn encode(&self, out: &mut dyn BufMut)

Provided Methods§

Source

fn length(&self) -> usize

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Encodable for H64

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for H128

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for H160

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for H256

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for H512

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for H520

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for String

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

fn length(&self) -> usize

Source§

impl Encodable for U64

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for U128

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for U512

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for bool

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for u8

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for u16

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for u32

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for u64

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for u128

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl Encodable for usize

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl<'a, T> Encodable for &'a T
where T: 'a + Encodable + ?Sized,

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

fn length(&self) -> usize

Source§

impl<'a> Encodable for &'a [u8]

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl<T, const LEN: usize> Encodable for ArrayVec<T, LEN>
where T: Encodable + 'static,

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl<T, const LEN: usize> Encodable for [T; LEN]
where T: Encodable + 'static,

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

impl<T> Encodable for Arc<T>
where T: Encodable + ?Sized,

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

fn length(&self) -> usize

Source§

impl<T> Encodable for Box<T>
where T: Encodable + ?Sized,

Source§

fn encode(&self, out: &mut dyn BufMut)

Source§

fn length(&self) -> usize

Source§

impl<T> Encodable for Vec<T>
where T: Encodable + 'static,

Source§

fn length(&self) -> usize

Source§

fn encode(&self, out: &mut dyn BufMut)

Implementors§