Trait FromBytes

Source
pub trait FromBytes: Sized {
    // Required method
    fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>;

    // Provided method
    fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error> { ... }
}
Expand description

A type which can be deserialized from a Vec<u8>.

Required Methods§

Source

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Deserializes the slice into Self.

Provided Methods§

Source

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Deserializes the Vec<u8> into Self.

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 FromBytes for bool

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for i32

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for i64

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for u8

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for u16

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for u32

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for u64

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for u128

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for ()

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for String

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl FromBytes for [U512; 14]

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<K, V> FromBytes for BTreeMap<K, V>
where K: FromBytes + Ord, V: FromBytes,

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes> FromBytes for (T1,)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes> FromBytes for (T1, T2)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes> FromBytes for (T1, T2, T3)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes> FromBytes for (T1, T2, T3, T4)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes, T5: FromBytes> FromBytes for (T1, T2, T3, T4, T5)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes, T5: FromBytes, T6: FromBytes> FromBytes for (T1, T2, T3, T4, T5, T6)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes, T5: FromBytes, T6: FromBytes, T7: FromBytes> FromBytes for (T1, T2, T3, T4, T5, T6, T7)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes, T5: FromBytes, T6: FromBytes, T7: FromBytes, T8: FromBytes> FromBytes for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes, T5: FromBytes, T6: FromBytes, T7: FromBytes, T8: FromBytes, T9: FromBytes> FromBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T1: FromBytes, T2: FromBytes, T3: FromBytes, T4: FromBytes, T5: FromBytes, T6: FromBytes, T7: FromBytes, T8: FromBytes, T9: FromBytes, T10: FromBytes> FromBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T> FromBytes for Ratio<T>
where T: Clone + FromBytes + Integer,

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T: FromBytes> FromBytes for Option<T>

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<T: FromBytes> FromBytes for VecDeque<T>

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Source§

impl<T: FromBytes> FromBytes for Vec<T>

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Source§

impl<T: FromBytes, E: FromBytes> FromBytes for Result<T, E>

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<V: FromBytes + Ord> FromBytes for BTreeSet<V>

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Source§

impl<const COUNT: usize> FromBytes for [u8; COUNT]

Source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Implementors§

Source§

impl FromBytes for EntityKindTag

Source§

impl FromBytes for MessagePayload

Source§

impl FromBytes for MessageTopicOperation

Source§

impl FromBytes for ContractPackageStatus

Source§

impl FromBytes for PublicKey

Source§

impl FromBytes for Signature

Source§

impl FromBytes for ActivationPoint

Available on crate feature std only.
Source§

impl FromBytes for AddressableEntityIdentifier

Source§

impl FromBytes for Block

Source§

impl FromBytes for BlockBody

Source§

impl FromBytes for BlockGlobalAddr

Source§

impl FromBytes for BlockGlobalAddrTag

Source§

impl FromBytes for BlockHeader

Source§

impl FromBytes for BlockIdentifier

Source§

impl FromBytes for BlockSignatures

Source§

impl FromBytes for ByteCodeAddr

Source§

impl FromBytes for ByteCodeKind

Source§

impl FromBytes for CLType

Source§

impl FromBytes for ConsensusProtocolName

Available on crate feature std only.
Source§

impl FromBytes for ContractRuntimeTag

Source§

impl FromBytes for EntityAddr

Source§

impl FromBytes for EntityKind

Source§

impl FromBytes for EntryPointAccess

Source§

impl FromBytes for EntryPointAddr

Source§

impl FromBytes for EntryPointPayment

Source§

impl FromBytes for EntryPointType

Source§

impl FromBytes for EntryPointValue

Source§

impl FromBytes for EraEnd

Source§

impl FromBytes for ExecutableDeployItem

Source§

impl FromBytes for FeeHandling

Available on crate feature std only.
Source§

impl FromBytes for GenesisAccount

Available on crate feature std only.
Source§

impl FromBytes for GlobalStateIdentifier

Source§

impl FromBytes for HoldBalanceHandling

Available on crate feature std only.
Source§

impl FromBytes for InitiatorAddr

Source§

impl FromBytes for Key

Source§

impl FromBytes for KeyTag

Source§

impl FromBytes for LegacyRequiredFinality

Available on crate feature std only.
Source§

impl FromBytes for PackageIdentifier

Source§

impl FromBytes for PackageStatus

Source§

impl FromBytes for Phase

Source§

impl FromBytes for PricingHandling

Available on crate feature std only.
Source§

impl FromBytes for PricingMode

Source§

impl FromBytes for RefundHandling

Available on crate feature std only.
Source§

impl FromBytes for StoredValue

Source§

impl FromBytes for Transaction

Source§

impl FromBytes for TransactionArgs

Source§

impl FromBytes for TransactionEntryPoint

Source§

impl FromBytes for TransactionHash

Source§

impl FromBytes for TransactionInvocationTarget

Source§

impl FromBytes for TransactionRuntimeParams

Source§

impl FromBytes for TransactionScheduling

Source§

impl FromBytes for TransactionTarget

Source§

impl FromBytes for Transfer

Source§

impl FromBytes for ValidatorChange

Source§

impl FromBytes for ExecutionResult

Source§

impl FromBytes for TransformError

Source§

impl FromBytes for TransformKindV2

Source§

impl FromBytes for ExecutionResultV1

Source§

impl FromBytes for OpKind

Source§

impl FromBytes for TransformKindV1

Source§

impl FromBytes for Pointer

Source§

impl FromBytes for TrieMerkleProofStep

Source§

impl FromBytes for BidAddr

Source§

impl FromBytes for BidKind

Source§

impl FromBytes for DelegatorKind

Source§

impl FromBytes for casper_types::system::auction::Error

Source§

impl FromBytes for SeigniorageAllocation

Source§

impl FromBytes for UnbondKind

Source§

impl FromBytes for CallStackElement

Source§

impl FromBytes for Caller

Source§

impl FromBytes for SystemEntityType

Source§

impl FromBytes for BalanceHoldAddr

Source§

impl FromBytes for BalanceHoldAddrTag

Source§

impl FromBytes for casper_types::system::mint::Error

Source§

impl FromBytes for casper_types::bytesrepr::Error

Source§

impl FromBytes for casper_types::account::action_thresholds::ActionThresholds

Source§

impl FromBytes for casper_types::account::associated_keys::AssociatedKeys

Source§

impl FromBytes for Account

Source§

impl FromBytes for AccountHash

Source§

impl FromBytes for casper_types::account::Weight

Source§

impl FromBytes for casper_types::addressable_entity::action_thresholds::ActionThresholds

Source§

impl FromBytes for casper_types::addressable_entity::associated_keys::AssociatedKeys

Source§

impl FromBytes for MessageTopics

Source§

impl FromBytes for NamedKeyAddr

Source§

impl FromBytes for NamedKeyValue

Source§

impl FromBytes for casper_types::addressable_entity::Weight

Source§

impl FromBytes for Message

Source§

impl FromBytes for MessageAddr

Source§

impl FromBytes for MessageChecksum

Source§

impl FromBytes for MessageTopicSummary

Source§

impl FromBytes for TopicNameHash

Source§

impl FromBytes for ContractHash

Source§

impl FromBytes for ContractPackage

Source§

impl FromBytes for ContractPackageHash

Source§

impl FromBytes for ContractVersionKey

Source§

impl FromBytes for EntryPoint

Source§

impl FromBytes for casper_types::contracts::EntryPoints

Source§

impl FromBytes for ExecutionEffect

Source§

impl FromBytes for NamedKey

Source§

impl FromBytes for Operation

Source§

impl FromBytes for TransformV1

Source§

impl FromBytes for Effects

Source§

impl FromBytes for ExecutionResultV2

Source§

impl FromBytes for TransformV2

Source§

impl FromBytes for AccessRights

Source§

impl FromBytes for AccountConfig

Available on crate feature std only.
Source§

impl FromBytes for AccountsConfig

Available on crate feature std only.
Source§

impl FromBytes for AddressableEntity

Source§

impl FromBytes for AddressableEntityHash

Source§

impl FromBytes for AdministratorAccount

Available on crate feature std only.
Source§

impl FromBytes for Approval

Source§

impl FromBytes for ApprovalsHash

Source§

impl FromBytes for AuctionCosts

Available on crate feature std only.
Source§

impl FromBytes for AvailableBlockRange

Source§

impl FromBytes for BlockBodyV1

Source§

impl FromBytes for BlockBodyV2

Source§

impl FromBytes for BlockHash

Source§

impl FromBytes for BlockHashAndHeight

Source§

impl FromBytes for BlockHeaderV1

Source§

impl FromBytes for BlockHeaderV2

Source§

impl FromBytes for BlockSignaturesV1

Source§

impl FromBytes for BlockSignaturesV2

Source§

impl FromBytes for BlockSyncStatus

Source§

impl FromBytes for BlockSynchronizerStatus

Source§

impl FromBytes for BlockTime

Source§

impl FromBytes for BlockV1

Source§

impl FromBytes for BlockV2

Source§

impl FromBytes for BlockWithSignatures

Source§

impl FromBytes for BrTableCost

Available on crate feature std only.
Source§

impl FromBytes for ByteCode

Source§

impl FromBytes for ByteCodeHash

Source§

impl FromBytes for CLValue

Source§

impl FromBytes for DictionaryValue

Source§

impl FromBytes for ChainNameDigest

Source§

impl FromBytes for Chainspec

Available on crate feature std only.
Source§

impl FromBytes for ChainspecRawBytes

Available on crate feature std only.
Source§

impl FromBytes for ChainspecRegistry

Available on crate feature std only.
Source§

impl FromBytes for ChecksumRegistry

Source§

impl FromBytes for ChunkWithProof

Source§

impl FromBytes for Contract

Source§

impl FromBytes for ContractWasm

Source§

impl FromBytes for ContractWasmHash

Source§

impl FromBytes for ControlFlowCosts

Available on crate feature std only.
Source§

impl FromBytes for CoreConfig

Available on crate feature std only.
Source§

impl FromBytes for DelegatorConfig

Available on crate feature std only.
Source§

impl FromBytes for Deploy

Source§

impl FromBytes for DeployConfig

Available on crate feature std only.
Source§

impl FromBytes for DeployHash

Source§

impl FromBytes for DeployHeader

Source§

impl FromBytes for DeployId

Source§

impl FromBytes for DeployInfo

Source§

impl FromBytes for Digest

Source§

impl FromBytes for EntityEntryPoint

Source§

impl FromBytes for EntityVersionKey

Source§

impl FromBytes for EntityVersions

Source§

impl FromBytes for casper_types::EntryPoints

Source§

impl FromBytes for EraEndV1

Source§

impl FromBytes for EraEndV2

Source§

impl FromBytes for EraId

Source§

impl FromBytes for ExecutionInfo

Source§

impl FromBytes for Gas

Source§

impl FromBytes for GenesisValidator

Available on crate feature std only.
Source§

impl FromBytes for GlobalStateUpdate

Available on crate feature std only.
Source§

impl FromBytes for Group

Source§

impl FromBytes for Groups

Source§

impl FromBytes for HandlePaymentCosts

Available on crate feature std only.
Source§

impl FromBytes for HighwayConfig

Available on crate feature std only.
Source§

impl FromBytes for HostFunctionCostsV1

Available on crate feature std only.
Source§

impl FromBytes for HostFunctionCostsV2

Available on crate feature std only.
Source§

impl FromBytes for IndexedMerkleProof

Source§

impl FromBytes for MessageLimits

Available on crate feature std only.
Source§

impl FromBytes for MintCosts

Available on crate feature std only.
Source§

impl FromBytes for Motes

Source§

impl FromBytes for NamedArg

Source§

impl FromBytes for NamedKeys

Source§

impl FromBytes for NetworkConfig

Available on crate feature std only.
Source§

impl FromBytes for NextUpgrade

Available on crate feature std only.
Source§

impl FromBytes for OpcodeCosts

Available on crate feature std only.
Source§

impl FromBytes for Package

Source§

impl FromBytes for PackageHash

Source§

impl FromBytes for Parameter

Source§

impl FromBytes for PeerEntry

Source§

impl FromBytes for Peers

Source§

impl FromBytes for ProtocolConfig

Available on crate feature std only.
Source§

impl FromBytes for ProtocolVersion

Source§

impl FromBytes for RewardedSignatures

Source§

impl FromBytes for RuntimeArgs

Source§

impl FromBytes for SemVer

Source§

impl FromBytes for SingleBlockRewardedSignatures

Source§

impl FromBytes for StandardPaymentCosts

Available on crate feature std only.
Source§

impl FromBytes for StorageCosts

Available on crate feature std only.
Source§

impl FromBytes for TypeMismatch

Source§

impl FromBytes for SystemConfig

Available on crate feature std only.
Source§

impl FromBytes for SystemHashRegistry

Source§

impl FromBytes for TimeDiff

Source§

impl FromBytes for Timestamp

Source§

impl FromBytes for TransactionConfig

Available on crate feature std only.
Source§

impl FromBytes for TransactionId

Source§

impl FromBytes for TransactionV1

Source§

impl FromBytes for TransactionV1Config

Available on crate feature std only.
Source§

impl FromBytes for TransactionV1Hash

Source§

impl FromBytes for TransactionV1Payload

Source§

impl FromBytes for TransferAddr

Source§

impl FromBytes for TransferV1

Source§

impl FromBytes for TransferV2

Source§

impl FromBytes for U128

Source§

impl FromBytes for U256

Source§

impl FromBytes for U512

Source§

impl FromBytes for URef

Source§

impl FromBytes for VacancyConfig

Available on crate feature std only.
Source§

impl FromBytes for ValidatorConfig

Available on crate feature std only.
Source§

impl FromBytes for WasmConfig

Available on crate feature std only.
Source§

impl FromBytes for WasmV1Config

Available on crate feature std only.
Source§

impl FromBytes for WasmV2Config

Available on crate feature std only.
Source§

impl FromBytes for Bid

Source§

impl FromBytes for Bridge

Source§

impl FromBytes for Delegator

Source§

impl FromBytes for DelegatorBid

Source§

impl FromBytes for EraInfo

Source§

impl FromBytes for Reservation

Source§

impl FromBytes for SeigniorageRecipientV1

Source§

impl FromBytes for SeigniorageRecipientV2

Source§

impl FromBytes for Unbond

Source§

impl FromBytes for UnbondEra

Source§

impl FromBytes for UnbondingPurse

Source§

impl FromBytes for ValidatorBid

Source§

impl FromBytes for ValidatorCredit

Source§

impl FromBytes for WithdrawPurse

Source§

impl FromBytes for CallerInfo

Source§

impl FromBytes for Bytes

Source§

impl<K, V> FromBytes for TrieMerkleProof<K, V>
where K: FromBytes, V: FromBytes,

Source§

impl<T> FromBytes for HostFunction<T>
where T: Default + AsMut<[Cost]>,

Available on crate feature std only.
Source§

impl<VID: FromBytes + Ord> FromBytes for EraReport<VID>