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.

Implementations on Foreign Types§

§

impl Encodable for Vec<Transaction, Global>

§

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<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<'a, T> Encodable for &'a mut Twhere T: Encodable,

§

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

§

impl Encodable for Vec<Inventory, Global>

§

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

§

impl Encodable for Vec<PrefilledTransaction, Global>

§

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 i64

§

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

§

impl Encodable for [u8; 8]

§

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

§

impl Encodable for i32

§

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

§

impl Encodable for Box<[u8], Global>

§

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

§

impl Encodable for Vec<TxOut, Global>

§

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

§

impl Encodable for Vec<FilterHash, Global>

§

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

§

impl Encodable for Vec<u64, Global>

§

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,

§

impl Encodable for Vec<AddrV2Message, Global>

§

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 [u8; 32]

§

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

§

impl Encodable for Vec<ShortId, Global>

§

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

§

impl Encodable for [u8; 10]

§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>where W: WriteExt + ?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 Encodable for [u8; 4]

§

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

§

impl Encodable for u64

§

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

§

impl Encodable for Vec<TapLeafHash, Global>

§

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 Encodable for u8

§

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

§

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

§

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

§

impl Encodable for Vec<Vec<u8, Global>, Global>

§

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

§

impl Encodable for [u8; 16]

§

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

§

impl Encodable for u16

§

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

§

impl Encodable for Vec<VarInt, Global>

§

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

§

impl Encodable for Vec<(u32, Address), Global>

§

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<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> 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 Encodable for bool

§

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

§

impl Encodable for Vec<TxMerkleNode, Global>

§

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

§

impl Encodable for [u8; 33]

§

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

§

impl Encodable for Vec<FilterHeader, Global>

§

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

§

impl Encodable for Vec<BlockHash, Global>

§

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

§

impl Encodable for [u16; 8]

§

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

§

impl Encodable for [u8; 6]

§

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

§

impl Encodable for Cow<'static, str>

§

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<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 Encodable for String

§

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

§

impl Encodable for Vec<TxIn, Global>

§

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

§

impl Encodable for [u8; 12]

§

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

§

impl Encodable for Vec<u8, Global>

§

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,

Implementors§

§

impl Encodable for LockTime

§

impl Encodable for bitcoin::key::secp256k1::hashes::sha256::Hash

§

impl Encodable for bitcoin::key::secp256k1::hashes::sha256d::Hash

§

impl Encodable for Block

§

impl Encodable for BlockHash

§

impl Encodable for Header

§

impl Encodable for OutPoint

§

impl Encodable for PartialMerkleTree

§

impl Encodable for Script

§

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 CheckedData

§

impl Encodable for AddrV2

§

impl Encodable for AddrV2Message

§

impl Encodable for Address

§

impl Encodable for BlockTransactions

§

impl Encodable for BlockTransactionsRequest

§

impl Encodable for BlockTxn

§

impl Encodable for BloomFlags

§

impl Encodable for CFCheckpt

§

impl Encodable for CFHeaders

§

impl Encodable for CFilter

§

impl Encodable for CmpctBlock

§

impl Encodable for CommandString

§

impl Encodable for CompactTarget

§

impl Encodable for FilterAdd

§

impl Encodable for FilterHash

§

impl Encodable for FilterHeader

§

impl Encodable for FilterLoad

§

impl Encodable for GetBlockTxn

§

impl Encodable for GetBlocksMessage

§

impl Encodable for GetCFCheckpt

§

impl Encodable for GetCFHeaders

§

impl Encodable for GetCFilters

§

impl Encodable for GetHeadersMessage

§

impl Encodable for HeaderAndShortIds

§

impl Encodable for Inventory

§

impl Encodable for Magic

§

impl Encodable for MerkleBlock

§

impl Encodable for PrefilledTransaction

§

impl Encodable for RawNetworkMessage

§

impl Encodable for Reject

§

impl Encodable for RejectReason

§

impl Encodable for ScriptBuf

§

impl Encodable for SendCmpct

§

impl Encodable for Sequence

§

impl Encodable for ServiceFlags

§

impl Encodable for ShortId

§

impl Encodable for TapLeafHash

§

impl Encodable for Version

§

impl Encodable for VersionMessage

§

impl Encodable for Witness

§

impl Encodable for WitnessMerkleNode

§

impl Encodable for Wtxid

§

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

§

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