ckb_types::prelude

Trait Reader

Source
pub trait Reader<'r>:
    Sized
    + Debug
    + Clone
    + Copy {
    type Entity: Entity;

    const NAME: &'static str;

    // Required methods
    fn verify(slice: &[u8], compatible: bool) -> Result<(), VerificationError>;
    fn new_unchecked(slice: &'r [u8]) -> Self;
    fn as_slice(&self) -> &'r [u8] ;
    fn to_entity(&self) -> Self::Entity;

    // Provided methods
    fn from_slice(slice: &'r [u8]) -> Result<Self, VerificationError> { ... }
    fn from_compatible_slice(slice: &'r [u8]) -> Result<Self, VerificationError> { ... }
}

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Required Methods§

Source

fn verify(slice: &[u8], compatible: bool) -> Result<(), VerificationError>

Source

fn new_unchecked(slice: &'r [u8]) -> Self

Source

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

Source

fn to_entity(&self) -> Self::Entity

Provided Methods§

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<'r> Reader<'r> for AddressReader<'r>

Source§

const NAME: &'static str = "AddressReader"

Source§

type Entity = Address

Source§

impl<'r> Reader<'r> for AddressVecReader<'r>

Source§

const NAME: &'static str = "AddressVecReader"

Source§

type Entity = AddressVec

Source§

impl<'r> Reader<'r> for AlertReader<'r>

Source§

const NAME: &'static str = "AlertReader"

Source§

type Entity = Alert

Source§

impl<'r> Reader<'r> for BeUint32Reader<'r>

Source§

const NAME: &'static str = "BeUint32Reader"

Source§

type Entity = BeUint32

Source§

impl<'r> Reader<'r> for BeUint64Reader<'r>

Source§

const NAME: &'static str = "BeUint64Reader"

Source§

type Entity = BeUint64

Source§

impl<'r> Reader<'r> for BlockExtReader<'r>

Source§

const NAME: &'static str = "BlockExtReader"

Source§

type Entity = BlockExt

Source§

impl<'r> Reader<'r> for BlockExtV1Reader<'r>

Source§

const NAME: &'static str = "BlockExtV1Reader"

Source§

type Entity = BlockExtV1

Source§

impl<'r> Reader<'r> for BlockFilterCheckPointsReader<'r>

Source§

const NAME: &'static str = "BlockFilterCheckPointsReader"

Source§

type Entity = BlockFilterCheckPoints

Source§

impl<'r> Reader<'r> for BlockFilterHashesReader<'r>

Source§

const NAME: &'static str = "BlockFilterHashesReader"

Source§

type Entity = BlockFilterHashes

Source§

impl<'r> Reader<'r> for BlockFilterMessageReader<'r>

Source§

const NAME: &'static str = "BlockFilterMessageReader"

Source§

type Entity = BlockFilterMessage

Source§

impl<'r> Reader<'r> for BlockFiltersReader<'r>

Source§

const NAME: &'static str = "BlockFiltersReader"

Source§

type Entity = BlockFilters

Source§

impl<'r> Reader<'r> for BlockProposalReader<'r>

Source§

const NAME: &'static str = "BlockProposalReader"

Source§

type Entity = BlockProposal

Source§

impl<'r> Reader<'r> for BlockReader<'r>

Source§

const NAME: &'static str = "BlockReader"

Source§

type Entity = Block

Source§

impl<'r> Reader<'r> for BlockTransactionsReader<'r>

Source§

const NAME: &'static str = "BlockTransactionsReader"

Source§

type Entity = BlockTransactions

Source§

impl<'r> Reader<'r> for BlockV1Reader<'r>

Source§

const NAME: &'static str = "BlockV1Reader"

Source§

type Entity = BlockV1

Source§

impl<'r> Reader<'r> for BoolOptReader<'r>

Source§

const NAME: &'static str = "BoolOptReader"

Source§

type Entity = BoolOpt

Source§

impl<'r> Reader<'r> for BoolReader<'r>

Source§

const NAME: &'static str = "BoolReader"

Source§

type Entity = Bool

Source§

impl<'r> Reader<'r> for Byte32OptReader<'r>

Source§

const NAME: &'static str = "Byte32OptReader"

Source§

type Entity = Byte32Opt

Source§

impl<'r> Reader<'r> for Byte32Reader<'r>

Source§

const NAME: &'static str = "Byte32Reader"

Source§

type Entity = Byte32

Source§

impl<'r> Reader<'r> for Byte32VecReader<'r>

Source§

const NAME: &'static str = "Byte32VecReader"

Source§

type Entity = Byte32Vec

Source§

impl<'r> Reader<'r> for BytesOptReader<'r>

Source§

const NAME: &'static str = "BytesOptReader"

Source§

type Entity = BytesOpt

Source§

impl<'r> Reader<'r> for BytesOptVecReader<'r>

Source§

const NAME: &'static str = "BytesOptVecReader"

Source§

type Entity = BytesOptVec

Source§

impl<'r> Reader<'r> for BytesReader<'r>

Source§

const NAME: &'static str = "BytesReader"

Source§

type Entity = Bytes

Source§

impl<'r> Reader<'r> for BytesVecReader<'r>

Source§

const NAME: &'static str = "BytesVecReader"

Source§

type Entity = BytesVec

Source§

impl<'r> Reader<'r> for CellDataEntryReader<'r>

Source§

const NAME: &'static str = "CellDataEntryReader"

Source§

type Entity = CellDataEntry

Source§

impl<'r> Reader<'r> for CellDepReader<'r>

Source§

const NAME: &'static str = "CellDepReader"

Source§

type Entity = CellDep

Source§

impl<'r> Reader<'r> for CellDepVecReader<'r>

Source§

const NAME: &'static str = "CellDepVecReader"

Source§

type Entity = CellDepVec

Source§

impl<'r> Reader<'r> for CellEntryReader<'r>

Source§

const NAME: &'static str = "CellEntryReader"

Source§

type Entity = CellEntry

Source§

impl<'r> Reader<'r> for CellInputReader<'r>

Source§

const NAME: &'static str = "CellInputReader"

Source§

type Entity = CellInput

Source§

impl<'r> Reader<'r> for CellInputVecReader<'r>

Source§

const NAME: &'static str = "CellInputVecReader"

Source§

type Entity = CellInputVec

Source§

impl<'r> Reader<'r> for CellOutputOptReader<'r>

Source§

const NAME: &'static str = "CellOutputOptReader"

Source§

type Entity = CellOutputOpt

Source§

impl<'r> Reader<'r> for CellOutputReader<'r>

Source§

const NAME: &'static str = "CellOutputReader"

Source§

type Entity = CellOutput

Source§

impl<'r> Reader<'r> for CellOutputVecReader<'r>

Source§

const NAME: &'static str = "CellOutputVecReader"

Source§

type Entity = CellOutputVec

Source§

impl<'r> Reader<'r> for CellbaseWitnessReader<'r>

Source§

const NAME: &'static str = "CellbaseWitnessReader"

Source§

type Entity = CellbaseWitness

Source§

impl<'r> Reader<'r> for CompactBlockReader<'r>

Source§

const NAME: &'static str = "CompactBlockReader"

Source§

type Entity = CompactBlock

Source§

impl<'r> Reader<'r> for CompactBlockV1Reader<'r>

Source§

const NAME: &'static str = "CompactBlockV1Reader"

Source§

type Entity = CompactBlockV1

Source§

impl<'r> Reader<'r> for DiscoveryMessageReader<'r>

Source§

const NAME: &'static str = "DiscoveryMessageReader"

Source§

type Entity = DiscoveryMessage

Source§

impl<'r> Reader<'r> for DiscoveryPayloadReader<'r>

Source§

const NAME: &'static str = "DiscoveryPayloadReader"

Source§

type Entity = DiscoveryPayload

Source§

impl<'r> Reader<'r> for EpochExtReader<'r>

Source§

const NAME: &'static str = "EpochExtReader"

Source§

type Entity = EpochExt

Source§

impl<'r> Reader<'r> for FilteredBlockReader<'r>

Source§

const NAME: &'static str = "FilteredBlockReader"

Source§

type Entity = FilteredBlock

Source§

impl<'r> Reader<'r> for FilteredBlockVecReader<'r>

Source§

const NAME: &'static str = "FilteredBlockVecReader"

Source§

type Entity = FilteredBlockVec

Source§

impl<'r> Reader<'r> for GetBlockFilterCheckPointsReader<'r>

Source§

const NAME: &'static str = "GetBlockFilterCheckPointsReader"

Source§

type Entity = GetBlockFilterCheckPoints

Source§

impl<'r> Reader<'r> for GetBlockFilterHashesReader<'r>

Source§

const NAME: &'static str = "GetBlockFilterHashesReader"

Source§

type Entity = GetBlockFilterHashes

Source§

impl<'r> Reader<'r> for GetBlockFiltersReader<'r>

Source§

const NAME: &'static str = "GetBlockFiltersReader"

Source§

type Entity = GetBlockFilters

Source§

impl<'r> Reader<'r> for GetBlockProposalReader<'r>

Source§

const NAME: &'static str = "GetBlockProposalReader"

Source§

type Entity = GetBlockProposal

Source§

impl<'r> Reader<'r> for GetBlockTransactionsReader<'r>

Source§

const NAME: &'static str = "GetBlockTransactionsReader"

Source§

type Entity = GetBlockTransactions

Source§

impl<'r> Reader<'r> for GetBlocksProofReader<'r>

Source§

const NAME: &'static str = "GetBlocksProofReader"

Source§

type Entity = GetBlocksProof

Source§

impl<'r> Reader<'r> for GetBlocksReader<'r>

Source§

const NAME: &'static str = "GetBlocksReader"

Source§

type Entity = GetBlocks

Source§

impl<'r> Reader<'r> for GetHeadersReader<'r>

Source§

const NAME: &'static str = "GetHeadersReader"

Source§

type Entity = GetHeaders

Source§

impl<'r> Reader<'r> for GetLastStateProofReader<'r>

Source§

const NAME: &'static str = "GetLastStateProofReader"

Source§

type Entity = GetLastStateProof

Source§

impl<'r> Reader<'r> for GetLastStateReader<'r>

Source§

const NAME: &'static str = "GetLastStateReader"

Source§

type Entity = GetLastState

Source§

impl<'r> Reader<'r> for GetNodes2Reader<'r>

Source§

const NAME: &'static str = "GetNodes2Reader"

Source§

type Entity = GetNodes2

Source§

impl<'r> Reader<'r> for GetNodesReader<'r>

Source§

const NAME: &'static str = "GetNodesReader"

Source§

type Entity = GetNodes

Source§

impl<'r> Reader<'r> for GetRelayTransactionsReader<'r>

Source§

const NAME: &'static str = "GetRelayTransactionsReader"

Source§

type Entity = GetRelayTransactions

Source§

impl<'r> Reader<'r> for GetTransactionsProofReader<'r>

Source§

const NAME: &'static str = "GetTransactionsProofReader"

Source§

type Entity = GetTransactionsProof

Source§

impl<'r> Reader<'r> for HeaderDigestReader<'r>

Source§

const NAME: &'static str = "HeaderDigestReader"

Source§

type Entity = HeaderDigest

Source§

impl<'r> Reader<'r> for HeaderDigestVecReader<'r>

Source§

const NAME: &'static str = "HeaderDigestVecReader"

Source§

type Entity = HeaderDigestVec

Source§

impl<'r> Reader<'r> for HeaderReader<'r>

Source§

const NAME: &'static str = "HeaderReader"

Source§

type Entity = Header

Source§

impl<'r> Reader<'r> for HeaderVecReader<'r>

Source§

const NAME: &'static str = "HeaderVecReader"

Source§

type Entity = HeaderVec

Source§

impl<'r> Reader<'r> for HeaderViewReader<'r>

Source§

const NAME: &'static str = "HeaderViewReader"

Source§

type Entity = HeaderView

Source§

impl<'r> Reader<'r> for IdentifyMessageReader<'r>

Source§

const NAME: &'static str = "IdentifyMessageReader"

Source§

type Entity = IdentifyMessage

Source§

impl<'r> Reader<'r> for IdentifyReader<'r>

Source§

const NAME: &'static str = "IdentifyReader"

Source§

type Entity = Identify

Source§

impl<'r> Reader<'r> for InIBDReader<'r>

Source§

const NAME: &'static str = "InIBDReader"

Source§

type Entity = InIBD

Source§

impl<'r> Reader<'r> for IndexTransactionReader<'r>

Source§

const NAME: &'static str = "IndexTransactionReader"

Source§

type Entity = IndexTransaction

Source§

impl<'r> Reader<'r> for IndexTransactionVecReader<'r>

Source§

const NAME: &'static str = "IndexTransactionVecReader"

Source§

type Entity = IndexTransactionVec

Source§

impl<'r> Reader<'r> for LightClientMessageReader<'r>

Source§

const NAME: &'static str = "LightClientMessageReader"

Source§

type Entity = LightClientMessage

Source§

impl<'r> Reader<'r> for MerkleProofReader<'r>

Source§

const NAME: &'static str = "MerkleProofReader"

Source§

type Entity = MerkleProof

Source§

impl<'r> Reader<'r> for Node2Reader<'r>

Source§

const NAME: &'static str = "Node2Reader"

Source§

type Entity = Node2

Source§

impl<'r> Reader<'r> for Node2VecReader<'r>

Source§

const NAME: &'static str = "Node2VecReader"

Source§

type Entity = Node2Vec

Source§

impl<'r> Reader<'r> for NodeReader<'r>

Source§

const NAME: &'static str = "NodeReader"

Source§

type Entity = Node

Source§

impl<'r> Reader<'r> for NodeVecReader<'r>

Source§

const NAME: &'static str = "NodeVecReader"

Source§

type Entity = NodeVec

Source§

impl<'r> Reader<'r> for Nodes2Reader<'r>

Source§

const NAME: &'static str = "Nodes2Reader"

Source§

type Entity = Nodes2

Source§

impl<'r> Reader<'r> for NodesReader<'r>

Source§

const NAME: &'static str = "NodesReader"

Source§

type Entity = Nodes

Source§

impl<'r> Reader<'r> for NumberHashReader<'r>

Source§

const NAME: &'static str = "NumberHashReader"

Source§

type Entity = NumberHash

Source§

impl<'r> Reader<'r> for OutPointReader<'r>

Source§

const NAME: &'static str = "OutPointReader"

Source§

type Entity = OutPoint

Source§

impl<'r> Reader<'r> for OutPointVecReader<'r>

Source§

const NAME: &'static str = "OutPointVecReader"

Source§

type Entity = OutPointVec

Source§

impl<'r> Reader<'r> for PingMessageReader<'r>

Source§

const NAME: &'static str = "PingMessageReader"

Source§

type Entity = PingMessage

Source§

impl<'r> Reader<'r> for PingPayloadReader<'r>

Source§

const NAME: &'static str = "PingPayloadReader"

Source§

type Entity = PingPayload

Source§

impl<'r> Reader<'r> for PingReader<'r>

Source§

const NAME: &'static str = "PingReader"

Source§

type Entity = Ping

Source§

impl<'r> Reader<'r> for PongReader<'r>

Source§

const NAME: &'static str = "PongReader"

Source§

type Entity = Pong

Source§

impl<'r> Reader<'r> for PortOptReader<'r>

Source§

const NAME: &'static str = "PortOptReader"

Source§

type Entity = PortOpt

Source§

impl<'r> Reader<'r> for ProposalShortIdReader<'r>

Source§

const NAME: &'static str = "ProposalShortIdReader"

Source§

type Entity = ProposalShortId

Source§

impl<'r> Reader<'r> for ProposalShortIdVecReader<'r>

Source§

const NAME: &'static str = "ProposalShortIdVecReader"

Source§

type Entity = ProposalShortIdVec

Source§

impl<'r> Reader<'r> for RawAlertReader<'r>

Source§

const NAME: &'static str = "RawAlertReader"

Source§

type Entity = RawAlert

Source§

impl<'r> Reader<'r> for RawHeaderReader<'r>

Source§

const NAME: &'static str = "RawHeaderReader"

Source§

type Entity = RawHeader

Source§

impl<'r> Reader<'r> for RawTransactionReader<'r>

Source§

const NAME: &'static str = "RawTransactionReader"

Source§

type Entity = RawTransaction

Source§

impl<'r> Reader<'r> for RelayMessageReader<'r>

Source§

const NAME: &'static str = "RelayMessageReader"

Source§

type Entity = RelayMessage

Source§

impl<'r> Reader<'r> for RelayTransactionHashesReader<'r>

Source§

const NAME: &'static str = "RelayTransactionHashesReader"

Source§

type Entity = RelayTransactionHashes

Source§

impl<'r> Reader<'r> for RelayTransactionReader<'r>

Source§

const NAME: &'static str = "RelayTransactionReader"

Source§

type Entity = RelayTransaction

Source§

impl<'r> Reader<'r> for RelayTransactionVecReader<'r>

Source§

const NAME: &'static str = "RelayTransactionVecReader"

Source§

type Entity = RelayTransactionVec

Source§

impl<'r> Reader<'r> for RelayTransactionsReader<'r>

Source§

const NAME: &'static str = "RelayTransactionsReader"

Source§

type Entity = RelayTransactions

Source§

impl<'r> Reader<'r> for ScriptOptReader<'r>

Source§

const NAME: &'static str = "ScriptOptReader"

Source§

type Entity = ScriptOpt

Source§

impl<'r> Reader<'r> for ScriptReader<'r>

Source§

const NAME: &'static str = "ScriptReader"

Source§

type Entity = Script

Source§

impl<'r> Reader<'r> for SendBlockReader<'r>

Source§

const NAME: &'static str = "SendBlockReader"

Source§

type Entity = SendBlock

Source§

impl<'r> Reader<'r> for SendBlocksProofReader<'r>

Source§

const NAME: &'static str = "SendBlocksProofReader"

Source§

type Entity = SendBlocksProof

Source§

impl<'r> Reader<'r> for SendBlocksProofV1Reader<'r>

Source§

const NAME: &'static str = "SendBlocksProofV1Reader"

Source§

type Entity = SendBlocksProofV1

Source§

impl<'r> Reader<'r> for SendHeadersReader<'r>

Source§

const NAME: &'static str = "SendHeadersReader"

Source§

type Entity = SendHeaders

Source§

impl<'r> Reader<'r> for SendLastStateProofReader<'r>

Source§

const NAME: &'static str = "SendLastStateProofReader"

Source§

type Entity = SendLastStateProof

Source§

impl<'r> Reader<'r> for SendLastStateReader<'r>

Source§

const NAME: &'static str = "SendLastStateReader"

Source§

type Entity = SendLastState

Source§

impl<'r> Reader<'r> for SendTransactionsProofReader<'r>

Source§

const NAME: &'static str = "SendTransactionsProofReader"

Source§

type Entity = SendTransactionsProof

Source§

impl<'r> Reader<'r> for SendTransactionsProofV1Reader<'r>

Source§

const NAME: &'static str = "SendTransactionsProofV1Reader"

Source§

type Entity = SendTransactionsProofV1

Source§

impl<'r> Reader<'r> for SyncMessageReader<'r>

Source§

const NAME: &'static str = "SyncMessageReader"

Source§

type Entity = SyncMessage

Source§

impl<'r> Reader<'r> for TimeReader<'r>

Source§

const NAME: &'static str = "TimeReader"

Source§

type Entity = Time

Source§

impl<'r> Reader<'r> for TransactionInfoReader<'r>

Source§

const NAME: &'static str = "TransactionInfoReader"

Source§

type Entity = TransactionInfo

Source§

impl<'r> Reader<'r> for TransactionKeyReader<'r>

Source§

const NAME: &'static str = "TransactionKeyReader"

Source§

type Entity = TransactionKey

Source§

impl<'r> Reader<'r> for TransactionReader<'r>

Source§

const NAME: &'static str = "TransactionReader"

Source§

type Entity = Transaction

Source§

impl<'r> Reader<'r> for TransactionVecReader<'r>

Source§

const NAME: &'static str = "TransactionVecReader"

Source§

type Entity = TransactionVec

Source§

impl<'r> Reader<'r> for TransactionViewReader<'r>

Source§

const NAME: &'static str = "TransactionViewReader"

Source§

type Entity = TransactionView

Source§

impl<'r> Reader<'r> for Uint16Reader<'r>

Source§

const NAME: &'static str = "Uint16Reader"

Source§

type Entity = Uint16

Source§

impl<'r> Reader<'r> for Uint32Reader<'r>

Source§

const NAME: &'static str = "Uint32Reader"

Source§

type Entity = Uint32

Source§

impl<'r> Reader<'r> for Uint32VecReader<'r>

Source§

const NAME: &'static str = "Uint32VecReader"

Source§

type Entity = Uint32Vec

Source§

impl<'r> Reader<'r> for Uint64Reader<'r>

Source§

const NAME: &'static str = "Uint64Reader"

Source§

type Entity = Uint64

Source§

impl<'r> Reader<'r> for Uint64VecOptReader<'r>

Source§

const NAME: &'static str = "Uint64VecOptReader"

Source§

type Entity = Uint64VecOpt

Source§

impl<'r> Reader<'r> for Uint64VecReader<'r>

Source§

const NAME: &'static str = "Uint64VecReader"

Source§

type Entity = Uint64Vec

Source§

impl<'r> Reader<'r> for Uint128Reader<'r>

Source§

const NAME: &'static str = "Uint128Reader"

Source§

type Entity = Uint128

Source§

impl<'r> Reader<'r> for Uint256Reader<'r>

Source§

const NAME: &'static str = "Uint256Reader"

Source§

type Entity = Uint256

Source§

impl<'r> Reader<'r> for Uint256VecReader<'r>

Source§

const NAME: &'static str = "Uint256VecReader"

Source§

type Entity = Uint256Vec

Source§

impl<'r> Reader<'r> for UncleBlockReader<'r>

Source§

const NAME: &'static str = "UncleBlockReader"

Source§

type Entity = UncleBlock

Source§

impl<'r> Reader<'r> for UncleBlockVecReader<'r>

Source§

const NAME: &'static str = "UncleBlockVecReader"

Source§

type Entity = UncleBlockVec

Source§

impl<'r> Reader<'r> for UncleBlockVecViewReader<'r>

Source§

const NAME: &'static str = "UncleBlockVecViewReader"

Source§

type Entity = UncleBlockVecView

Source§

impl<'r> Reader<'r> for VerifiableHeaderReader<'r>

Source§

const NAME: &'static str = "VerifiableHeaderReader"

Source§

type Entity = VerifiableHeader

Source§

impl<'r> Reader<'r> for VerifiableHeaderVecReader<'r>

Source§

const NAME: &'static str = "VerifiableHeaderVecReader"

Source§

type Entity = VerifiableHeaderVec

Source§

impl<'r> Reader<'r> for WitnessArgsReader<'r>

Source§

const NAME: &'static str = "WitnessArgsReader"

Source§

type Entity = WitnessArgs