Trait serde::de::Deserialize[][src]

pub trait Deserialize<'de>: Sized {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>
; }
Expand description

A data structure that can be deserialized from any data format supported by Serde.

Serde provides Deserialize implementations for many Rust primitive and standard library types. The complete list is here. All of these can be deserialized using Serde out of the box.

Additionally, Serde provides a procedural macro called serde_derive to automatically generate Deserialize implementations for structs and enums in your program. See the derive section of the manual for how to use this.

In rare cases it may be necessary to implement Deserialize manually for some type in your program. See the Implementing Deserialize section of the manual for more about this.

Third-party crates may provide Deserialize implementations for types that they expose. For example the linked-hash-map crate provides a LinkedHashMap<K, V> type that is deserializable by Serde because the crate provides an implementation of Deserialize for it.

Lifetime

The 'de lifetime of this trait is the lifetime of data that may be borrowed by Self when deserialized. See the page Understanding deserializer lifetimes for a more detailed explanation of these lifetimes.

Required methods

Deserialize this value from the given Serde deserializer.

See the Implementing Deserialize section of the manual for more information about how to implement this method.

Implementations on Foreign Types

This impl requires the "rc" Cargo feature of Serde. The resulting Weak<T> has a reference count of 0 and cannot be upgraded.

This impl requires the "rc" Cargo feature of Serde. The resulting Weak<T> has a reference count of 0 and cannot be upgraded.

This impl requires the "rc" Cargo feature of Serde.

Deserializing a data structure containing Rc will not attempt to deduplicate Rc references to the same data. Every deserialized Rc will end up with a strong count of 1.

This impl requires the "rc" Cargo feature of Serde.

Deserializing a data structure containing Arc will not attempt to deduplicate Arc references to the same data. Every deserialized Arc will end up with a strong count of 1.

Implementors

impl<'de, Block: BlockType + Deserialize<'de>> Deserialize<'de> for BitVec<Block>

impl<'de, T, N> Deserialize<'de> for GenericArray<T, N> where
    T: Deserialize<'de> + Default,
    N: ArrayLength<T>, 

impl<'de> Deserialize<'de> for PublicKey

impl<'a, 'de: 'a> Deserialize<'de> for &'a Bytes

impl<'de> Deserialize<'de> for ByteBuf

impl<'de> Deserialize<'de> for UpgradeableLoaderState

impl<'de> Deserialize<'de> for Clock

impl<'de> Deserialize<'de> for EpochSchedule

impl<'de> Deserialize<'de> for Feature

impl<'de> Deserialize<'de> for FeeCalculator

impl<'de> Deserialize<'de> for FeeRateGovernor

impl<'de> Deserialize<'de> for Hash

impl<'de> Deserialize<'de> for InstructionError

impl<'de> Deserialize<'de> for Instruction

impl<'de> Deserialize<'de> for AccountMeta

impl<'de> Deserialize<'de> for CompiledInstruction

impl<'de> Deserialize<'de> for Hash

impl<'de> Deserialize<'de> for LoaderInstruction

impl<'de> Deserialize<'de> for UpgradeableLoaderInstruction

impl<'de> Deserialize<'de> for MessageHeader

impl<'de> Deserialize<'de> for Message

impl<'de> Deserialize<'de> for Data

impl<'de> Deserialize<'de> for State

impl<'de> Deserialize<'de> for Versions

impl<'de> Deserialize<'de> for ProgramError

impl<'de> Deserialize<'de> for Pubkey

impl<'de> Deserialize<'de> for Rent

impl<'de> Deserialize<'de> for ShortU16

impl<'de, T: Deserialize<'de>> Deserialize<'de> for ShortVec<T>

impl<'de> Deserialize<'de> for SlotHashes

impl<'de> Deserialize<'de> for SlotHistory

impl<'de> Deserialize<'de> for Config

impl<'de> Deserialize<'de> for StakeInstruction

impl<'de> Deserialize<'de> for LockupArgs

impl<'de> Deserialize<'de> for LockupCheckedArgs

impl<'de> Deserialize<'de> for AuthorizeWithSeedArgs

impl<'de> Deserialize<'de> for AuthorizeCheckedWithSeedArgs

impl<'de> Deserialize<'de> for StakeState

impl<'de> Deserialize<'de> for StakeAuthorize

impl<'de> Deserialize<'de> for Lockup

impl<'de> Deserialize<'de> for Authorized

impl<'de> Deserialize<'de> for Meta

impl<'de> Deserialize<'de> for Delegation

impl<'de> Deserialize<'de> for Stake

impl<'de> Deserialize<'de> for StakeHistoryEntry

impl<'de> Deserialize<'de> for StakeHistory

impl<'de> Deserialize<'de> for SystemInstruction

impl<'de> Deserialize<'de> for Fees

impl<'de> Deserialize<'de> for Entry

impl<'de> Deserialize<'de> for RecentBlockhashes

impl<'de> Deserialize<'de> for Rewards