ckb_types::prelude

Trait Entity

Source
pub trait Entity:
    Debug
    + Default
    + Clone {
    type Builder: Builder;

    const NAME: &'static str;

    // Required methods
    fn new_unchecked(data: Bytes) -> Self;
    fn as_bytes(&self) -> Bytes;
    fn as_slice(&self) -> &[u8] ;
    fn from_slice(slice: &[u8]) -> Result<Self, VerificationError>;
    fn from_compatible_slice(slice: &[u8]) -> Result<Self, VerificationError>;
    fn new_builder() -> Self::Builder;
    fn as_builder(self) -> Self::Builder;
}

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Required Methods§

Source

fn new_unchecked(data: Bytes) -> Self

Source

fn as_bytes(&self) -> Bytes

Source

fn as_slice(&self) -> &[u8]

Source

fn from_slice(slice: &[u8]) -> Result<Self, VerificationError>

Source

fn from_compatible_slice(slice: &[u8]) -> Result<Self, VerificationError>

Source

fn new_builder() -> Self::Builder

Source

fn as_builder(self) -> Self::Builder

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§

Source§

impl Entity for Address

Source§

const NAME: &'static str = "Address"

Source§

type Builder = AddressBuilder

Source§

impl Entity for AddressVec

Source§

const NAME: &'static str = "AddressVec"

Source§

type Builder = AddressVecBuilder

Source§

impl Entity for Alert

Source§

const NAME: &'static str = "Alert"

Source§

type Builder = AlertBuilder

Source§

impl Entity for BeUint32

Source§

const NAME: &'static str = "BeUint32"

Source§

type Builder = BeUint32Builder

Source§

impl Entity for BeUint64

Source§

const NAME: &'static str = "BeUint64"

Source§

type Builder = BeUint64Builder

Source§

impl Entity for Block

Source§

const NAME: &'static str = "Block"

Source§

type Builder = BlockBuilder

Source§

impl Entity for BlockExt

Source§

const NAME: &'static str = "BlockExt"

Source§

type Builder = BlockExtBuilder

Source§

impl Entity for BlockExtV1

Source§

const NAME: &'static str = "BlockExtV1"

Source§

type Builder = BlockExtV1Builder

Source§

impl Entity for BlockFilterCheckPoints

Source§

const NAME: &'static str = "BlockFilterCheckPoints"

Source§

type Builder = BlockFilterCheckPointsBuilder

Source§

impl Entity for BlockFilterHashes

Source§

const NAME: &'static str = "BlockFilterHashes"

Source§

type Builder = BlockFilterHashesBuilder

Source§

impl Entity for BlockFilterMessage

Source§

const NAME: &'static str = "BlockFilterMessage"

Source§

type Builder = BlockFilterMessageBuilder

Source§

impl Entity for BlockFilters

Source§

const NAME: &'static str = "BlockFilters"

Source§

type Builder = BlockFiltersBuilder

Source§

impl Entity for BlockProposal

Source§

const NAME: &'static str = "BlockProposal"

Source§

type Builder = BlockProposalBuilder

Source§

impl Entity for BlockTransactions

Source§

const NAME: &'static str = "BlockTransactions"

Source§

type Builder = BlockTransactionsBuilder

Source§

impl Entity for BlockV1

Source§

const NAME: &'static str = "BlockV1"

Source§

type Builder = BlockV1Builder

Source§

impl Entity for Bool

Source§

const NAME: &'static str = "Bool"

Source§

type Builder = BoolBuilder

Source§

impl Entity for BoolOpt

Source§

const NAME: &'static str = "BoolOpt"

Source§

type Builder = BoolOptBuilder

Source§

impl Entity for Byte32

Source§

const NAME: &'static str = "Byte32"

Source§

type Builder = Byte32Builder

Source§

impl Entity for Byte32Opt

Source§

const NAME: &'static str = "Byte32Opt"

Source§

type Builder = Byte32OptBuilder

Source§

impl Entity for Byte32Vec

Source§

const NAME: &'static str = "Byte32Vec"

Source§

type Builder = Byte32VecBuilder

Source§

impl Entity for Bytes

Source§

const NAME: &'static str = "Bytes"

Source§

type Builder = BytesBuilder

Source§

impl Entity for BytesOpt

Source§

const NAME: &'static str = "BytesOpt"

Source§

type Builder = BytesOptBuilder

Source§

impl Entity for BytesOptVec

Source§

const NAME: &'static str = "BytesOptVec"

Source§

type Builder = BytesOptVecBuilder

Source§

impl Entity for BytesVec

Source§

const NAME: &'static str = "BytesVec"

Source§

type Builder = BytesVecBuilder

Source§

impl Entity for CellDataEntry

Source§

const NAME: &'static str = "CellDataEntry"

Source§

type Builder = CellDataEntryBuilder

Source§

impl Entity for CellDep

Source§

const NAME: &'static str = "CellDep"

Source§

type Builder = CellDepBuilder

Source§

impl Entity for CellDepVec

Source§

const NAME: &'static str = "CellDepVec"

Source§

type Builder = CellDepVecBuilder

Source§

impl Entity for CellEntry

Source§

const NAME: &'static str = "CellEntry"

Source§

type Builder = CellEntryBuilder

Source§

impl Entity for CellInput

Source§

const NAME: &'static str = "CellInput"

Source§

type Builder = CellInputBuilder

Source§

impl Entity for CellInputVec

Source§

const NAME: &'static str = "CellInputVec"

Source§

type Builder = CellInputVecBuilder

Source§

impl Entity for CellOutput

Source§

const NAME: &'static str = "CellOutput"

Source§

type Builder = CellOutputBuilder

Source§

impl Entity for CellOutputOpt

Source§

const NAME: &'static str = "CellOutputOpt"

Source§

type Builder = CellOutputOptBuilder

Source§

impl Entity for CellOutputVec

Source§

const NAME: &'static str = "CellOutputVec"

Source§

type Builder = CellOutputVecBuilder

Source§

impl Entity for CellbaseWitness

Source§

const NAME: &'static str = "CellbaseWitness"

Source§

type Builder = CellbaseWitnessBuilder

Source§

impl Entity for CompactBlock

Source§

const NAME: &'static str = "CompactBlock"

Source§

type Builder = CompactBlockBuilder

Source§

impl Entity for CompactBlockV1

Source§

const NAME: &'static str = "CompactBlockV1"

Source§

type Builder = CompactBlockV1Builder

Source§

impl Entity for DiscoveryMessage

Source§

const NAME: &'static str = "DiscoveryMessage"

Source§

type Builder = DiscoveryMessageBuilder

Source§

impl Entity for DiscoveryPayload

Source§

const NAME: &'static str = "DiscoveryPayload"

Source§

type Builder = DiscoveryPayloadBuilder

Source§

impl Entity for EpochExt

Source§

const NAME: &'static str = "EpochExt"

Source§

type Builder = EpochExtBuilder

Source§

impl Entity for FilteredBlock

Source§

const NAME: &'static str = "FilteredBlock"

Source§

type Builder = FilteredBlockBuilder

Source§

impl Entity for FilteredBlockVec

Source§

const NAME: &'static str = "FilteredBlockVec"

Source§

type Builder = FilteredBlockVecBuilder

Source§

impl Entity for GetBlockFilterCheckPoints

Source§

const NAME: &'static str = "GetBlockFilterCheckPoints"

Source§

type Builder = GetBlockFilterCheckPointsBuilder

Source§

impl Entity for GetBlockFilterHashes

Source§

const NAME: &'static str = "GetBlockFilterHashes"

Source§

type Builder = GetBlockFilterHashesBuilder

Source§

impl Entity for GetBlockFilters

Source§

const NAME: &'static str = "GetBlockFilters"

Source§

type Builder = GetBlockFiltersBuilder

Source§

impl Entity for GetBlockProposal

Source§

const NAME: &'static str = "GetBlockProposal"

Source§

type Builder = GetBlockProposalBuilder

Source§

impl Entity for GetBlockTransactions

Source§

const NAME: &'static str = "GetBlockTransactions"

Source§

type Builder = GetBlockTransactionsBuilder

Source§

impl Entity for GetBlocks

Source§

const NAME: &'static str = "GetBlocks"

Source§

type Builder = GetBlocksBuilder

Source§

impl Entity for GetBlocksProof

Source§

const NAME: &'static str = "GetBlocksProof"

Source§

type Builder = GetBlocksProofBuilder

Source§

impl Entity for GetHeaders

Source§

const NAME: &'static str = "GetHeaders"

Source§

type Builder = GetHeadersBuilder

Source§

impl Entity for GetLastState

Source§

const NAME: &'static str = "GetLastState"

Source§

type Builder = GetLastStateBuilder

Source§

impl Entity for GetLastStateProof

Source§

const NAME: &'static str = "GetLastStateProof"

Source§

type Builder = GetLastStateProofBuilder

Source§

impl Entity for GetNodes2

Source§

const NAME: &'static str = "GetNodes2"

Source§

type Builder = GetNodes2Builder

Source§

impl Entity for GetNodes

Source§

const NAME: &'static str = "GetNodes"

Source§

type Builder = GetNodesBuilder

Source§

impl Entity for GetRelayTransactions

Source§

const NAME: &'static str = "GetRelayTransactions"

Source§

type Builder = GetRelayTransactionsBuilder

Source§

impl Entity for GetTransactionsProof

Source§

const NAME: &'static str = "GetTransactionsProof"

Source§

type Builder = GetTransactionsProofBuilder

Source§

impl Entity for Header

Source§

const NAME: &'static str = "Header"

Source§

type Builder = HeaderBuilder

Source§

impl Entity for HeaderDigest

Source§

const NAME: &'static str = "HeaderDigest"

Source§

type Builder = HeaderDigestBuilder

Source§

impl Entity for HeaderDigestVec

Source§

const NAME: &'static str = "HeaderDigestVec"

Source§

type Builder = HeaderDigestVecBuilder

Source§

impl Entity for HeaderVec

Source§

const NAME: &'static str = "HeaderVec"

Source§

type Builder = HeaderVecBuilder

Source§

impl Entity for HeaderView

Source§

const NAME: &'static str = "HeaderView"

Source§

type Builder = HeaderViewBuilder

Source§

impl Entity for Identify

Source§

const NAME: &'static str = "Identify"

Source§

type Builder = IdentifyBuilder

Source§

impl Entity for IdentifyMessage

Source§

const NAME: &'static str = "IdentifyMessage"

Source§

type Builder = IdentifyMessageBuilder

Source§

impl Entity for InIBD

Source§

const NAME: &'static str = "InIBD"

Source§

type Builder = InIBDBuilder

Source§

impl Entity for IndexTransaction

Source§

const NAME: &'static str = "IndexTransaction"

Source§

type Builder = IndexTransactionBuilder

Source§

impl Entity for IndexTransactionVec

Source§

const NAME: &'static str = "IndexTransactionVec"

Source§

type Builder = IndexTransactionVecBuilder

Source§

impl Entity for LightClientMessage

Source§

const NAME: &'static str = "LightClientMessage"

Source§

type Builder = LightClientMessageBuilder

Source§

impl Entity for MerkleProof

Source§

const NAME: &'static str = "MerkleProof"

Source§

type Builder = MerkleProofBuilder

Source§

impl Entity for Node2

Source§

const NAME: &'static str = "Node2"

Source§

type Builder = Node2Builder

Source§

impl Entity for Node2Vec

Source§

const NAME: &'static str = "Node2Vec"

Source§

type Builder = Node2VecBuilder

Source§

impl Entity for Node

Source§

const NAME: &'static str = "Node"

Source§

type Builder = NodeBuilder

Source§

impl Entity for NodeVec

Source§

const NAME: &'static str = "NodeVec"

Source§

type Builder = NodeVecBuilder

Source§

impl Entity for Nodes2

Source§

const NAME: &'static str = "Nodes2"

Source§

type Builder = Nodes2Builder

Source§

impl Entity for Nodes

Source§

const NAME: &'static str = "Nodes"

Source§

type Builder = NodesBuilder

Source§

impl Entity for NumberHash

Source§

const NAME: &'static str = "NumberHash"

Source§

type Builder = NumberHashBuilder

Source§

impl Entity for OutPoint

Source§

const NAME: &'static str = "OutPoint"

Source§

type Builder = OutPointBuilder

Source§

impl Entity for OutPointVec

Source§

const NAME: &'static str = "OutPointVec"

Source§

type Builder = OutPointVecBuilder

Source§

impl Entity for Ping

Source§

const NAME: &'static str = "Ping"

Source§

type Builder = PingBuilder

Source§

impl Entity for PingMessage

Source§

const NAME: &'static str = "PingMessage"

Source§

type Builder = PingMessageBuilder

Source§

impl Entity for PingPayload

Source§

const NAME: &'static str = "PingPayload"

Source§

type Builder = PingPayloadBuilder

Source§

impl Entity for Pong

Source§

const NAME: &'static str = "Pong"

Source§

type Builder = PongBuilder

Source§

impl Entity for PortOpt

Source§

const NAME: &'static str = "PortOpt"

Source§

type Builder = PortOptBuilder

Source§

impl Entity for ProposalShortId

Source§

const NAME: &'static str = "ProposalShortId"

Source§

type Builder = ProposalShortIdBuilder

Source§

impl Entity for ProposalShortIdVec

Source§

const NAME: &'static str = "ProposalShortIdVec"

Source§

type Builder = ProposalShortIdVecBuilder

Source§

impl Entity for RawAlert

Source§

const NAME: &'static str = "RawAlert"

Source§

type Builder = RawAlertBuilder

Source§

impl Entity for RawHeader

Source§

const NAME: &'static str = "RawHeader"

Source§

type Builder = RawHeaderBuilder

Source§

impl Entity for RawTransaction

Source§

const NAME: &'static str = "RawTransaction"

Source§

type Builder = RawTransactionBuilder

Source§

impl Entity for RelayMessage

Source§

const NAME: &'static str = "RelayMessage"

Source§

type Builder = RelayMessageBuilder

Source§

impl Entity for RelayTransaction

Source§

const NAME: &'static str = "RelayTransaction"

Source§

type Builder = RelayTransactionBuilder

Source§

impl Entity for RelayTransactionHashes

Source§

const NAME: &'static str = "RelayTransactionHashes"

Source§

type Builder = RelayTransactionHashesBuilder

Source§

impl Entity for RelayTransactionVec

Source§

const NAME: &'static str = "RelayTransactionVec"

Source§

type Builder = RelayTransactionVecBuilder

Source§

impl Entity for RelayTransactions

Source§

const NAME: &'static str = "RelayTransactions"

Source§

type Builder = RelayTransactionsBuilder

Source§

impl Entity for Script

Source§

const NAME: &'static str = "Script"

Source§

type Builder = ScriptBuilder

Source§

impl Entity for ScriptOpt

Source§

const NAME: &'static str = "ScriptOpt"

Source§

type Builder = ScriptOptBuilder

Source§

impl Entity for SendBlock

Source§

const NAME: &'static str = "SendBlock"

Source§

type Builder = SendBlockBuilder

Source§

impl Entity for SendBlocksProof

Source§

const NAME: &'static str = "SendBlocksProof"

Source§

type Builder = SendBlocksProofBuilder

Source§

impl Entity for SendBlocksProofV1

Source§

const NAME: &'static str = "SendBlocksProofV1"

Source§

type Builder = SendBlocksProofV1Builder

Source§

impl Entity for SendHeaders

Source§

const NAME: &'static str = "SendHeaders"

Source§

type Builder = SendHeadersBuilder

Source§

impl Entity for SendLastState

Source§

const NAME: &'static str = "SendLastState"

Source§

type Builder = SendLastStateBuilder

Source§

impl Entity for SendLastStateProof

Source§

const NAME: &'static str = "SendLastStateProof"

Source§

type Builder = SendLastStateProofBuilder

Source§

impl Entity for SendTransactionsProof

Source§

const NAME: &'static str = "SendTransactionsProof"

Source§

type Builder = SendTransactionsProofBuilder

Source§

impl Entity for SendTransactionsProofV1

Source§

const NAME: &'static str = "SendTransactionsProofV1"

Source§

type Builder = SendTransactionsProofV1Builder

Source§

impl Entity for SyncMessage

Source§

const NAME: &'static str = "SyncMessage"

Source§

type Builder = SyncMessageBuilder

Source§

impl Entity for Time

Source§

const NAME: &'static str = "Time"

Source§

type Builder = TimeBuilder

Source§

impl Entity for Transaction

Source§

const NAME: &'static str = "Transaction"

Source§

type Builder = TransactionBuilder

Source§

impl Entity for TransactionInfo

Source§

const NAME: &'static str = "TransactionInfo"

Source§

type Builder = TransactionInfoBuilder

Source§

impl Entity for TransactionKey

Source§

const NAME: &'static str = "TransactionKey"

Source§

type Builder = TransactionKeyBuilder

Source§

impl Entity for TransactionVec

Source§

const NAME: &'static str = "TransactionVec"

Source§

type Builder = TransactionVecBuilder

Source§

impl Entity for TransactionView

Source§

const NAME: &'static str = "TransactionView"

Source§

type Builder = TransactionViewBuilder

Source§

impl Entity for Uint16

Source§

const NAME: &'static str = "Uint16"

Source§

type Builder = Uint16Builder

Source§

impl Entity for Uint32

Source§

const NAME: &'static str = "Uint32"

Source§

type Builder = Uint32Builder

Source§

impl Entity for Uint32Vec

Source§

const NAME: &'static str = "Uint32Vec"

Source§

type Builder = Uint32VecBuilder

Source§

impl Entity for Uint64

Source§

const NAME: &'static str = "Uint64"

Source§

type Builder = Uint64Builder

Source§

impl Entity for Uint64Vec

Source§

const NAME: &'static str = "Uint64Vec"

Source§

type Builder = Uint64VecBuilder

Source§

impl Entity for Uint64VecOpt

Source§

const NAME: &'static str = "Uint64VecOpt"

Source§

type Builder = Uint64VecOptBuilder

Source§

impl Entity for Uint128

Source§

const NAME: &'static str = "Uint128"

Source§

type Builder = Uint128Builder

Source§

impl Entity for Uint256

Source§

const NAME: &'static str = "Uint256"

Source§

type Builder = Uint256Builder

Source§

impl Entity for Uint256Vec

Source§

const NAME: &'static str = "Uint256Vec"

Source§

type Builder = Uint256VecBuilder

Source§

impl Entity for UncleBlock

Source§

const NAME: &'static str = "UncleBlock"

Source§

type Builder = UncleBlockBuilder

Source§

impl Entity for UncleBlockVec

Source§

const NAME: &'static str = "UncleBlockVec"

Source§

type Builder = UncleBlockVecBuilder

Source§

impl Entity for UncleBlockVecView

Source§

const NAME: &'static str = "UncleBlockVecView"

Source§

type Builder = UncleBlockVecViewBuilder

Source§

impl Entity for VerifiableHeader

Source§

const NAME: &'static str = "VerifiableHeader"

Source§

type Builder = VerifiableHeaderBuilder

Source§

impl Entity for VerifiableHeaderVec

Source§

const NAME: &'static str = "VerifiableHeaderVec"

Source§

type Builder = VerifiableHeaderVecBuilder

Source§

impl Entity for WitnessArgs

Source§

const NAME: &'static str = "WitnessArgs"

Source§

type Builder = WitnessArgsBuilder