Encodable

Trait Encodable 

Source
pub trait Encodable {
    type Encoder<'s>: Encoder
       where Self: 's;

    // Required method
    fn encoder(&self) -> Self::Encoder<'_>;
}
Expand description

A Bitcoin object which can be consensus-encoded.

To encode something, use the Self::encoder method to obtain a Self::Encoder, which will behave like an iterator yielding byte slices.

Required Associated Types§

Source

type Encoder<'s>: Encoder where Self: 's

The encoder associated with this type. Conceptually, the encoder is like an iterator which yields byte slices.

Required Methods§

Source

fn encoder(&self) -> Self::Encoder<'_>

Constructs a “default encoder” for the type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§