ckb_gen_types::prelude

Trait Pack

Source
pub trait Pack<T: Entity> {
    // Required method
    fn pack(&self) -> T;
}
Expand description

A syntactic sugar to convert a rust type into binary data.

Required Methods§

Source

fn pack(&self) -> T

Packs a rust type into binary data.

Implementations on Foreign Types§

Source§

impl Pack<BeUint32> for u32

Source§

fn pack(&self) -> BeUint32

Source§

impl Pack<BeUint32> for usize

Source§

fn pack(&self) -> BeUint32

Source§

impl Pack<BeUint64> for u64

Source§

fn pack(&self) -> BeUint64

Source§

impl Pack<Bool> for bool

Source§

fn pack(&self) -> Bool

Source§

impl Pack<BoolOpt> for Option<bool>

Source§

fn pack(&self) -> BoolOpt

Source§

impl Pack<Byte32> for H256

Source§

fn pack(&self) -> Byte32

Source§

impl Pack<Byte32> for [u8; 32]

Source§

fn pack(&self) -> Byte32

Source§

impl Pack<Byte32Opt> for Option<Byte32>

Source§

fn pack(&self) -> Byte32Opt

Source§

impl Pack<Byte32Opt> for Option<H256>

Source§

fn pack(&self) -> Byte32Opt

Source§

impl Pack<Bytes> for str

Source§

fn pack(&self) -> Bytes

Source§

impl Pack<Bytes> for String

Source§

fn pack(&self) -> Bytes

Source§

impl Pack<Bytes> for Bytes

Source§

fn pack(&self) -> Bytes

Source§

impl Pack<Bytes> for [u8]

Source§

fn pack(&self) -> Bytes

Source§

impl Pack<BytesOpt> for Option<&str>

Source§

fn pack(&self) -> BytesOpt

Source§

impl Pack<BytesOpt> for Option<Bytes>

Source§

fn pack(&self) -> BytesOpt

Source§

impl Pack<BytesOpt> for Option<String>

Source§

fn pack(&self) -> BytesOpt

Source§

impl Pack<BytesOpt> for Option<Bytes>

Source§

fn pack(&self) -> BytesOpt

Source§

impl Pack<BytesVec> for [Bytes]

Source§

fn pack(&self) -> BytesVec

Source§

impl Pack<CellOutputOpt> for Option<CellOutput>

Source§

impl Pack<ProposalShortId> for [u8; 10]

Source§

impl Pack<ScriptOpt> for Option<Script>

Source§

fn pack(&self) -> ScriptOpt

Source§

impl Pack<Uint32> for u32

Source§

fn pack(&self) -> Uint32

Source§

impl Pack<Uint32> for usize

Source§

fn pack(&self) -> Uint32

Source§

impl Pack<Uint32Vec> for [u32]

Source§

fn pack(&self) -> Uint32Vec

Source§

impl Pack<Uint32Vec> for [usize]

Source§

fn pack(&self) -> Uint32Vec

Source§

impl Pack<Uint64> for u64

Source§

fn pack(&self) -> Uint64

Source§

impl Pack<Uint64> for Capacity

Source§

fn pack(&self) -> Uint64

Source§

impl Pack<Uint64Vec> for [u64]

Source§

fn pack(&self) -> Uint64Vec

Source§

impl Pack<Uint64Vec> for [Capacity]

Source§

fn pack(&self) -> Uint64Vec

Source§

impl Pack<Uint64VecOpt> for Option<Vec<u64>>

Source§

impl Pack<Uint128> for u128

Source§

fn pack(&self) -> Uint128

Source§

impl Pack<Uint256> for U256

Source§

fn pack(&self) -> Uint256

Implementors§