bdk_chain::bitcoin::consensus::encode

Trait Encodable

pub trait Encodable {
    // Required method
    fn consensus_encode<W>(&self, writer: &mut W) -> Result<usize, Error>
       where W: Write + ?Sized;
}
Expand description

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

Required Methods§

fn consensus_encode<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

Encodes an object with a well-defined format.

§Returns

The number of bytes written on success. The only errors returned are errors propagated from the writer.

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.

Implementations on Foreign Types§

§

impl Encodable for Cow<'static, str>

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for bool

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for i8

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for i16

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for i32

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for i64

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for u8

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for u16

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for u32

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for u64

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for Box<[u8]>

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl Encodable for [u8; 2]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 4]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 6]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 8]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 10]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 12]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 16]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 32]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u8; 33]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: WriteExt + ?Sized,

§

impl Encodable for [u16; 8]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl<'a, T> Encodable for &'a mut T
where T: Encodable,

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

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

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl<T> Encodable for Rc<T>
where T: Encodable,

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

§

impl<T> Encodable for Arc<T>
where T: Encodable,

Note: This will fail to compile on old Rust for targets that don’t support atomics

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

Implementors§

§

impl Encodable for LockTime

§

impl Encodable for AddrV2

§

impl Encodable for NetworkMessage

§

impl Encodable for Inventory

§

impl Encodable for BloomFlags

§

impl Encodable for RejectReason

§

impl Encodable for String

§

impl Encodable for Vec<(u32, Address)>

§

impl Encodable for Vec<Inventory>

§

impl Encodable for Vec<u8>

§

impl Encodable for Vec<u64>

§

impl Encodable for Vec<Vec<u8>>

§

impl Encodable for Vec<PrefilledTransaction>

§

impl Encodable for Vec<ShortId>

§

impl Encodable for Vec<Header>

§

impl Encodable for Vec<AddrV2Message>

§

impl Encodable for Vec<BlockHash>

§

impl Encodable for Vec<FilterHash>

§

impl Encodable for Vec<FilterHeader>

§

impl Encodable for Vec<TapLeafHash>

§

impl Encodable for Vec<Transaction>

§

impl Encodable for Vec<TxIn>

§

impl Encodable for Vec<TxMerkleNode>

§

impl Encodable for Vec<TxOut>

§

impl Encodable for Vec<VarInt>

§

impl Encodable for BlockTransactions

§

impl Encodable for BlockTransactionsRequest

§

impl Encodable for HeaderAndShortIds

§

impl Encodable for PrefilledTransaction

§

impl Encodable for ShortId

§

impl Encodable for Header

§

impl Encodable for bdk_chain::bitcoin::blockdata::block::Version

§

impl Encodable for bdk_chain::bitcoin::blockdata::transaction::Version

§

impl Encodable for bdk_chain::bitcoin::hashes::sha256::Hash

§

impl Encodable for bdk_chain::bitcoin::hashes::sha256d::Hash

§

impl Encodable for PartialMerkleTree

§

impl Encodable for AddrV2Message

§

impl Encodable for CommandString

§

impl Encodable for RawNetworkMessage

§

impl Encodable for GetBlocksMessage

§

impl Encodable for GetHeadersMessage

§

impl Encodable for FilterAdd

§

impl Encodable for FilterLoad

§

impl Encodable for BlockTxn

§

impl Encodable for CmpctBlock

§

impl Encodable for GetBlockTxn

§

impl Encodable for SendCmpct

§

impl Encodable for CFCheckpt

§

impl Encodable for CFHeaders

§

impl Encodable for CFilter

§

impl Encodable for GetCFCheckpt

§

impl Encodable for GetCFHeaders

§

impl Encodable for GetCFilters

§

impl Encodable for Reject

§

impl Encodable for VersionMessage

§

impl Encodable for Address

§

impl Encodable for Magic

§

impl Encodable for ServiceFlags

§

impl Encodable for Amount

§

impl Encodable for Block

§

impl Encodable for BlockHash

§

impl Encodable for CompactTarget

§

impl Encodable for FilterHash

§

impl Encodable for FilterHeader

§

impl Encodable for MerkleBlock

§

impl Encodable for OutPoint

§

impl Encodable for Script

§

impl Encodable for ScriptBuf

§

impl Encodable for Sequence

§

impl Encodable for TapLeafHash

§

impl Encodable for Transaction

§

impl Encodable for TxIn

§

impl Encodable for TxMerkleNode

§

impl Encodable for TxOut

§

impl Encodable for Txid

§

impl Encodable for VarInt

§

impl Encodable for Witness

§

impl Encodable for WitnessMerkleNode

§

impl Encodable for Wtxid

§

impl Encodable for CheckedData

§

impl<'a> Encodable for Annex<'a>

§

impl<Subtype> Encodable for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8>,