pub trait Encodable {
    // Required method
    fn encode<W: Write>(&self, e: &mut W) -> Result<usize, Error>;
}
Expand description

Data which can be encoded in a consensus-consistent way.

Required Methods§

source

fn encode<W: Write>(&self, e: &mut W) -> Result<usize, Error>

Encode an object with a well-defined format. Should only ever error if the underlying Write errors. Returns the number of bytes written on success.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Encodable for &str

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl Encodable for bool

source§

impl Encodable for f32

source§

impl Encodable for f64

source§

impl Encodable for i8

source§

impl Encodable for i16

source§

impl Encodable for i32

source§

impl Encodable for i64

source§

impl Encodable for i128

source§

impl Encodable for u8

source§

impl Encodable for u16

source§

impl Encodable for u32

source§

impl Encodable for u64

source§

impl Encodable for u128

source§

impl Encodable for usize

source§

impl Encodable for String

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl Encodable for BigInt

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for BigUint

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for BuildMetadata

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Prerelease

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Version

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Url

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Address

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Ep

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Eq

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Fp

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Fq

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Hash

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl Encodable for Position

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<C: Encodable> Encodable for Checkpoint<C>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<H: Encodable + Ord + Clone> Encodable for MerkleBridge<H>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<H: Encodable + Ord + Clone> Encodable for NonEmptyFrontier<H>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<H: Encodable + Ord + Clone, C: Encodable + Debug, const DEPTH: u8> Encodable for BridgeTree<H, C, DEPTH>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<T0: Encodable, T1: Encodable> Encodable for (T0, T1)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T0: Encodable, T1: Encodable, T2: Encodable> Encodable for (T0, T1, T2)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T0: Encodable, T1: Encodable, T2: Encodable, T3: Encodable> Encodable for (T0, T1, T2, T3)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T0: Encodable, T1: Encodable, T2: Encodable, T3: Encodable, T4: Encodable> Encodable for (T0, T1, T2, T3, T4)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T0: Encodable, T1: Encodable, T2: Encodable, T3: Encodable, T4: Encodable, T5: Encodable> Encodable for (T0, T1, T2, T3, T4, T5)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T0: Encodable, T1: Encodable, T2: Encodable, T3: Encodable, T4: Encodable, T5: Encodable, T6: Encodable> Encodable for (T0, T1, T2, T3, T4, T5, T6)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T0: Encodable, T1: Encodable, T2: Encodable, T3: Encodable, T4: Encodable, T5: Encodable, T6: Encodable, T7: Encodable> Encodable for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T, const N: usize> Encodable for [T; N]
where T: Encodable,

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T: Encodable> Encodable for Option<T>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T: Encodable> Encodable for BTreeSet<T>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<T: Encodable> Encodable for VecDeque<T>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T: Encodable> Encodable for Vec<T>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>

source§

impl<T: Encodable> Encodable for HashSet<T>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<T: Encodable, U: Encodable> Encodable for BTreeMap<T, U>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

source§

impl<T: Encodable, U: Encodable> Encodable for HashMap<T, U>

source§

fn encode<S: Write>(&self, s: &mut S) -> Result<usize>

Implementors§