pub trait ToBytes {
// Required methods
fn to_bytes(&self) -> Result<Vec<u8>, Error>;
fn serialized_length(&self) -> usize;
// Provided methods
fn into_bytes(self) -> Result<Vec<u8>, Error>
where Self: Sized { ... }
fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error> { ... }
}Expand description
A type which can be serialized to a Vec<u8>.
Required Methods§
Sourcefn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the Vec<u8> which would be returned from a successful call to
to_bytes() or into_bytes(). The data is not actually serialized, so this call is
relatively cheap.
Provided Methods§
Implementations on Foreign Types§
Source§impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes> ToBytes for (T1, T2, T3, T4, T5)
impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes> ToBytes for (T1, T2, T3, T4, T5)
Source§impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6)
impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6)
Source§impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7)
impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7)
Source§impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes, T8: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7, T8)
impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes, T8: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7, T8)
Source§impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes, T8: ToBytes, T9: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9)
impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes, T8: ToBytes, T9: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9)
Source§impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes, T8: ToBytes, T9: ToBytes, T10: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
impl<T1: ToBytes, T2: ToBytes, T3: ToBytes, T4: ToBytes, T5: ToBytes, T6: ToBytes, T7: ToBytes, T8: ToBytes, T9: ToBytes, T10: ToBytes> ToBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
Implementors§
impl ToBytes for EntityKindTag
impl ToBytes for MessagePayload
impl ToBytes for MessageTopicOperation
impl ToBytes for ContractPackageStatus
impl ToBytes for PublicKey
impl ToBytes for Signature
impl ToBytes for ActivationPoint
Available on crate feature
std only.impl ToBytes for AddressableEntityIdentifier
impl ToBytes for Block
impl ToBytes for BlockBody
impl ToBytes for BlockGlobalAddr
impl ToBytes for BlockGlobalAddrTag
impl ToBytes for BlockHeader
impl ToBytes for BlockIdentifier
impl ToBytes for BlockSignatures
impl ToBytes for ByteCodeAddr
impl ToBytes for ByteCodeKind
impl ToBytes for ConsensusProtocolName
Available on crate feature
std only.impl ToBytes for ContractRuntimeTag
impl ToBytes for EntityAddr
impl ToBytes for EntityKind
impl ToBytes for EntryPointAccess
impl ToBytes for EntryPointAddr
impl ToBytes for EntryPointPayment
impl ToBytes for EntryPointType
impl ToBytes for EntryPointValue
impl ToBytes for EraEnd
impl ToBytes for ExecutableDeployItem
impl ToBytes for FeeHandling
Available on crate feature
std only.impl ToBytes for GenesisAccount
Available on crate feature
std only.impl ToBytes for GlobalStateIdentifier
impl ToBytes for HoldBalanceHandling
Available on crate feature
std only.impl ToBytes for InitiatorAddr
impl ToBytes for Key
impl ToBytes for KeyTag
impl ToBytes for LegacyRequiredFinality
Available on crate feature
std only.impl ToBytes for PackageIdentifier
impl ToBytes for PackageStatus
impl ToBytes for Phase
impl ToBytes for PricingHandling
Available on crate feature
std only.impl ToBytes for PricingMode
impl ToBytes for RefundHandling
Available on crate feature
std only.impl ToBytes for StoredValue
impl ToBytes for Transaction
impl ToBytes for TransactionArgs
impl ToBytes for TransactionEntryPoint
impl ToBytes for TransactionHash
impl ToBytes for TransactionInvocationTarget
impl ToBytes for TransactionRuntimeParams
impl ToBytes for TransactionScheduling
impl ToBytes for TransactionTarget
impl ToBytes for Transfer
impl ToBytes for ValidatorChange
impl ToBytes for ExecutionResult
impl ToBytes for TransformError
impl ToBytes for TransformKindV2
impl ToBytes for ExecutionResultV1
impl ToBytes for OpKind
impl ToBytes for TransformKindV1
impl ToBytes for Pointer
impl ToBytes for TrieMerkleProofStep
impl ToBytes for BidAddr
impl ToBytes for BidKind
impl ToBytes for DelegatorKind
impl ToBytes for casper_types::system::auction::Error
impl ToBytes for SeigniorageAllocation
impl ToBytes for UnbondKind
impl ToBytes for CallStackElement
impl ToBytes for Caller
impl ToBytes for SystemEntityType
impl ToBytes for casper_types::system::handle_payment::Error
impl ToBytes for BalanceHoldAddr
impl ToBytes for BalanceHoldAddrTag
impl ToBytes for casper_types::system::mint::Error
impl ToBytes for casper_types::bytesrepr::Error
impl ToBytes for casper_types::account::action_thresholds::ActionThresholds
impl ToBytes for casper_types::account::associated_keys::AssociatedKeys
impl ToBytes for Account
impl ToBytes for AccountHash
impl ToBytes for casper_types::account::Weight
impl ToBytes for casper_types::addressable_entity::action_thresholds::ActionThresholds
impl ToBytes for casper_types::addressable_entity::associated_keys::AssociatedKeys
impl ToBytes for MessageTopics
impl ToBytes for NamedKeyAddr
impl ToBytes for NamedKeyValue
impl ToBytes for casper_types::addressable_entity::Weight
impl ToBytes for Message
impl ToBytes for MessageAddr
impl ToBytes for MessageChecksum
impl ToBytes for MessageTopicSummary
impl ToBytes for TopicNameHash
impl ToBytes for ContractHash
impl ToBytes for ContractPackage
impl ToBytes for ContractPackageHash
impl ToBytes for ContractVersionKey
impl ToBytes for EntryPoint
impl ToBytes for casper_types::contracts::EntryPoints
impl ToBytes for ExecutionEffect
impl ToBytes for NamedKey
impl ToBytes for Operation
impl ToBytes for TransformV1
impl ToBytes for Effects
impl ToBytes for ExecutionResultV2
impl ToBytes for TransformV2
impl ToBytes for AccessRights
impl ToBytes for AccountConfig
Available on crate feature
std only.impl ToBytes for AccountsConfig
Available on crate feature
std only.impl ToBytes for AddressableEntity
impl ToBytes for AddressableEntityHash
impl ToBytes for AdministratorAccount
Available on crate feature
std only.impl ToBytes for Approval
impl ToBytes for ApprovalsHash
impl ToBytes for AuctionCosts
Available on crate feature
std only.impl ToBytes for AvailableBlockRange
impl ToBytes for BlockBodyV1
impl ToBytes for BlockBodyV2
impl ToBytes for BlockHash
impl ToBytes for BlockHashAndHeight
impl ToBytes for BlockHeaderV1
impl ToBytes for BlockHeaderV2
impl ToBytes for BlockSignaturesV1
impl ToBytes for BlockSignaturesV2
impl ToBytes for BlockSyncStatus
impl ToBytes for BlockSynchronizerStatus
impl ToBytes for BlockTime
impl ToBytes for BlockV1
impl ToBytes for BlockV2
impl ToBytes for BlockWithSignatures
impl ToBytes for BrTableCost
Available on crate feature
std only.impl ToBytes for ByteCode
impl ToBytes for ByteCodeHash
impl ToBytes for CLValue
impl ToBytes for DictionaryValue
impl ToBytes for ChainNameDigest
impl ToBytes for Chainspec
Available on crate feature
std only.impl ToBytes for ChainspecRawBytes
Available on crate feature
std only.impl ToBytes for ChainspecRegistry
Available on crate feature
std only.impl ToBytes for ChecksumRegistry
impl ToBytes for ChunkWithProof
impl ToBytes for Contract
impl ToBytes for ContractWasm
impl ToBytes for ContractWasmHash
impl ToBytes for ControlFlowCosts
Available on crate feature
std only.impl ToBytes for CoreConfig
Available on crate feature
std only.impl ToBytes for DelegatorConfig
Available on crate feature
std only.impl ToBytes for Deploy
impl ToBytes for DeployConfig
Available on crate feature
std only.impl ToBytes for DeployHash
impl ToBytes for DeployHeader
impl ToBytes for DeployId
impl ToBytes for DeployInfo
impl ToBytes for Digest
impl ToBytes for EntityEntryPoint
impl ToBytes for EntityVersionKey
impl ToBytes for EntityVersions
impl ToBytes for casper_types::EntryPoints
impl ToBytes for EraEndV1
impl ToBytes for EraEndV2
impl ToBytes for EraId
impl ToBytes for ExecutionInfo
impl ToBytes for Gas
impl ToBytes for GenesisValidator
Available on crate feature
std only.impl ToBytes for GlobalStateUpdate
Available on crate feature
std only.impl ToBytes for Group
impl ToBytes for Groups
impl ToBytes for HandlePaymentCosts
Available on crate feature
std only.impl ToBytes for HighwayConfig
Available on crate feature
std only.impl ToBytes for HostFunctionCostsV1
Available on crate feature
std only.impl ToBytes for HostFunctionCostsV2
Available on crate feature
std only.impl ToBytes for IndexedMerkleProof
impl ToBytes for MessageLimits
Available on crate feature
std only.impl ToBytes for MintCosts
Available on crate feature
std only.impl ToBytes for Motes
impl ToBytes for NamedArg
impl ToBytes for NamedKeys
impl ToBytes for NetworkConfig
Available on crate feature
std only.impl ToBytes for NextUpgrade
Available on crate feature
std only.impl ToBytes for OpcodeCosts
Available on crate feature
std only.impl ToBytes for Package
impl ToBytes for PackageHash
impl ToBytes for Parameter
impl ToBytes for PeerEntry
impl ToBytes for Peers
impl ToBytes for ProtocolConfig
Available on crate feature
std only.impl ToBytes for ProtocolVersion
impl ToBytes for RewardedSignatures
impl ToBytes for RuntimeArgs
impl ToBytes for SemVer
impl ToBytes for SingleBlockRewardedSignatures
impl ToBytes for StandardPaymentCosts
Available on crate feature
std only.impl ToBytes for StorageCosts
Available on crate feature
std only.impl ToBytes for TypeMismatch
impl ToBytes for SystemConfig
Available on crate feature
std only.impl ToBytes for SystemHashRegistry
impl ToBytes for TimeDiff
impl ToBytes for Timestamp
impl ToBytes for TransactionConfig
Available on crate feature
std only.impl ToBytes for TransactionId
impl ToBytes for TransactionV1
impl ToBytes for TransactionV1Config
Available on crate feature
std only.impl ToBytes for TransactionV1Hash
impl ToBytes for TransactionV1Payload
impl ToBytes for TransferAddr
impl ToBytes for TransferV1
impl ToBytes for TransferV2
impl ToBytes for U128
impl ToBytes for U256
impl ToBytes for U512
impl ToBytes for URef
impl ToBytes for VacancyConfig
Available on crate feature
std only.impl ToBytes for ValidatorConfig
Available on crate feature
std only.impl ToBytes for WasmConfig
Available on crate feature
std only.impl ToBytes for WasmV1Config
Available on crate feature
std only.impl ToBytes for WasmV2Config
Available on crate feature
std only.impl ToBytes for Bid
impl ToBytes for Bridge
impl ToBytes for Delegator
impl ToBytes for DelegatorBid
impl ToBytes for EraInfo
impl ToBytes for Reservation
impl ToBytes for SeigniorageRecipientV1
impl ToBytes for SeigniorageRecipientV2
impl ToBytes for Unbond
impl ToBytes for UnbondEra
impl ToBytes for UnbondingPurse
impl ToBytes for ValidatorBid
impl ToBytes for ValidatorCredit
impl ToBytes for WithdrawPurse
impl ToBytes for PrepaymentKind
impl ToBytes for CallerInfo
impl ToBytes for Bytes
impl<K, V> ToBytes for TrieMerkleProof<K, V>
impl<T> ToBytes for HostFunction<T>
Available on crate feature
std only.impl<T> ToBytes for HostFunctionV2<T>
Available on crate feature
std only.