Encodable

Trait Encodable 

Source
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§

Source

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§

Source§

impl Encodable for Cow<'static, str>

Source§

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

Source§

impl Encodable for bool

Source§

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

Source§

impl Encodable for i8

Source§

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

Source§

impl Encodable for i16

Source§

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

Source§

impl Encodable for i32

Source§

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

Source§

impl Encodable for i64

Source§

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

Source§

impl Encodable for u8

Source§

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

Source§

impl Encodable for u16

Source§

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

Source§

impl Encodable for u32

Source§

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

Source§

impl Encodable for u64

Source§

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

Source§

impl Encodable for Box<[u8]>

Source§

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

Source§

impl Encodable for [u8; 2]

Source§

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

Source§

impl Encodable for [u8; 4]

Source§

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

Source§

impl Encodable for [u8; 6]

Source§

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

Source§

impl Encodable for [u8; 8]

Source§

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

Source§

impl Encodable for [u8; 10]

Source§

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

Source§

impl Encodable for [u8; 12]

Source§

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

Source§

impl Encodable for [u8; 16]

Source§

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

Source§

impl Encodable for [u8; 32]

Source§

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

Source§

impl Encodable for [u8; 33]

Source§

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

Source§

impl Encodable for [u16; 8]

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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

Source§

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

Source§

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

Available on non-rust_v_1_60 or target_has_atomic=ptr only.

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

Source§

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

Implementors§

Source§

impl Encodable for LockTime

Source§

impl Encodable for AddrV2

Source§

impl Encodable for NetworkMessage

Source§

impl Encodable for Inventory

Source§

impl Encodable for BloomFlags

Source§

impl Encodable for RejectReason

Source§

impl Encodable for OutPoint

Source§

impl Encodable for Txid

Source§

impl Encodable for String

Source§

impl Encodable for Vec<(u32, Address)>

Source§

impl Encodable for Vec<Inventory>

Source§

impl Encodable for Vec<u8>

Source§

impl Encodable for Vec<u64>

Source§

impl Encodable for Vec<Vec<u8>>

Source§

impl Encodable for Vec<PrefilledTransaction>

Source§

impl Encodable for Vec<ShortId>

Source§

impl Encodable for Vec<Header>

Source§

impl Encodable for Vec<AddrV2Message>

Source§

impl Encodable for Vec<BlockHash>

Source§

impl Encodable for Vec<FilterHash>

Source§

impl Encodable for Vec<FilterHeader>

Source§

impl Encodable for Vec<TapLeafHash>

Source§

impl Encodable for Vec<Transaction>

Source§

impl Encodable for Vec<TxIn>

Source§

impl Encodable for Vec<TxMerkleNode>

Source§

impl Encodable for Vec<TxOut>

Source§

impl Encodable for Vec<VarInt>

Source§

impl Encodable for BlockTransactions

Source§

impl Encodable for BlockTransactionsRequest

Source§

impl Encodable for HeaderAndShortIds

Source§

impl Encodable for PrefilledTransaction

Source§

impl Encodable for ShortId

Source§

impl Encodable for Header

Source§

impl Encodable for rgb::invoice::bitcoin::blockdata::block::Version

Source§

impl Encodable for rgb::invoice::bitcoin::blockdata::transaction::Version

Source§

impl Encodable for rgb::invoice::bitcoin::hashes::sha256::Hash

Source§

impl Encodable for rgb::invoice::bitcoin::hashes::sha256d::Hash

Source§

impl Encodable for PartialMerkleTree

Source§

impl Encodable for AddrV2Message

Source§

impl Encodable for CommandString

Source§

impl Encodable for RawNetworkMessage

Source§

impl Encodable for GetBlocksMessage

Source§

impl Encodable for GetHeadersMessage

Source§

impl Encodable for FilterAdd

Source§

impl Encodable for FilterLoad

Source§

impl Encodable for BlockTxn

Source§

impl Encodable for CmpctBlock

Source§

impl Encodable for GetBlockTxn

Source§

impl Encodable for SendCmpct

Source§

impl Encodable for CFCheckpt

Source§

impl Encodable for CFHeaders

Source§

impl Encodable for CFilter

Source§

impl Encodable for GetCFCheckpt

Source§

impl Encodable for GetCFHeaders

Source§

impl Encodable for GetCFilters

Source§

impl Encodable for Reject

Source§

impl Encodable for VersionMessage

Source§

impl Encodable for Address

Source§

impl Encodable for Magic

Source§

impl Encodable for ServiceFlags

Source§

impl Encodable for Amount

Source§

impl Encodable for Block

Source§

impl Encodable for BlockHash

Source§

impl Encodable for CompactTarget

Source§

impl Encodable for FilterHash

Source§

impl Encodable for FilterHeader

Source§

impl Encodable for MerkleBlock

Source§

impl Encodable for Script

Source§

impl Encodable for ScriptBuf

Source§

impl Encodable for Sequence

Source§

impl Encodable for TapLeafHash

Source§

impl Encodable for Transaction

Source§

impl Encodable for TxIn

Source§

impl Encodable for TxMerkleNode

Source§

impl Encodable for TxOut

Source§

impl Encodable for VarInt

Source§

impl Encodable for Witness

Source§

impl Encodable for WitnessMerkleNode

Source§

impl Encodable for Wtxid

Source§

impl Encodable for CheckedData

Source§

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

Source§

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