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.

Object Safety§

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 ()

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 ContractPackageStatus

source§

impl FromBytes for PublicKey

source§

impl FromBytes for Signature

source§

impl FromBytes for CLType

source§

impl FromBytes for EntryPointAccess

source§

impl FromBytes for EntryPointType

source§

impl FromBytes for ExecutionResult

source§

impl FromBytes for Key

source§

impl FromBytes for OpKind

source§

impl FromBytes for Phase

source§

impl FromBytes for StoredValue

source§

impl FromBytes for Transform

source§

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

source§

impl FromBytes for SeigniorageAllocation

source§

impl FromBytes for CallStackElement

source§

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

source§

impl FromBytes for ActionThresholds

source§

impl FromBytes for AssociatedKeys

source§

impl FromBytes for Account

source§

impl FromBytes for AccountHash

source§

impl FromBytes for Weight

source§

impl FromBytes for AccessRights

source§

impl FromBytes for BlockTime

source§

impl FromBytes for CLValue

source§

impl FromBytes for Contract

source§

impl FromBytes for ContractHash

source§

impl FromBytes for ContractPackage

source§

impl FromBytes for ContractPackageHash

source§

impl FromBytes for ContractVersionKey

source§

impl FromBytes for ContractWasm

source§

impl FromBytes for ContractWasmHash

source§

impl FromBytes for DeployHash

source§

impl FromBytes for DeployInfo

source§

impl FromBytes for EntryPoint

source§

impl FromBytes for EntryPoints

source§

impl FromBytes for EraId

source§

impl FromBytes for ExecutionEffect

source§

impl FromBytes for Group

source§

impl FromBytes for Motes

source§

impl FromBytes for NamedArg

source§

impl FromBytes for NamedKey

source§

impl FromBytes for Operation

source§

impl FromBytes for Parameter

source§

impl FromBytes for ProtocolVersion

source§

impl FromBytes for RuntimeArgs

source§

impl FromBytes for SemVer

source§

impl FromBytes for TimeDiff

source§

impl FromBytes for Timestamp

source§

impl FromBytes for Transfer

source§

impl FromBytes for TransferAddr

source§

impl FromBytes for TransformEntry

source§

impl FromBytes for U128

source§

impl FromBytes for U256

source§

impl FromBytes for U512

source§

impl FromBytes for URef

source§

impl FromBytes for Bid

source§

impl FromBytes for Delegator

source§

impl FromBytes for EraInfo

source§

impl FromBytes for SeigniorageRecipient

source§

impl FromBytes for UnbondingPurse

source§

impl FromBytes for WithdrawPurse

source§

impl FromBytes for Bytes