rustc_serialize

Trait Decodable

source
pub trait Decodable<D: Decoder>: Sized {
    // Required method
    fn decode(d: &mut D) -> Self;
}
Expand description

Trait for types that can be deserialized

This can be implemented using the Decodable, TyDecodable and MetadataDecodable macros.

  • Decodable should be used in crates that don’t depend on rustc_middle.
  • MetadataDecodable is used in rustc_metadata for types that contain rustc_metadata::rmeta::Lazy.
  • TyDecodable should be used for types that are only serialized in crate metadata or the incremental cache. This is most types in rustc_middle.

Required Methods§

source

fn decode(d: &mut D) -> 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<'a> Decodable<MemDecoder<'a>> for Vec<u8>

source§

fn decode(d: &mut MemDecoder<'a>) -> Self

source§

impl<D: Decoder> Decodable<D> for Cow<'_, str>

source§

fn decode(d: &mut D) -> Cow<'static, str>

source§

impl<D: Decoder> Decodable<D> for bool

source§

impl<D: Decoder> Decodable<D> for char

source§

impl<D: Decoder> Decodable<D> for i8

source§

impl<D: Decoder> Decodable<D> for i16

source§

impl<D: Decoder> Decodable<D> for i32

source§

impl<D: Decoder> Decodable<D> for i64

source§

impl<D: Decoder> Decodable<D> for i128

source§

impl<D: Decoder> Decodable<D> for isize

source§

impl<D: Decoder> Decodable<D> for !

source§

impl<D: Decoder> Decodable<D> for u8

source§

impl<D: Decoder> Decodable<D> for u16

source§

impl<D: Decoder> Decodable<D> for u32

source§

impl<D: Decoder> Decodable<D> for u64

source§

impl<D: Decoder> Decodable<D> for u128

source§

impl<D: Decoder> Decodable<D> for ()

source§

impl<D: Decoder> Decodable<D> for usize

source§

impl<D: Decoder> Decodable<D> for String

source§

impl<D: Decoder> Decodable<D> for NonZero<u32>

source§

fn decode(d: &mut D) -> Self

source§

impl<D: Decoder> Decodable<D> for PathBuf

source§

impl<D: Decoder, A: Array<Item: Decodable<D>>> Decodable<D> for SmallVec<A>

source§

impl<D: Decoder, K, V> Decodable<D> for BTreeMap<K, V>
where K: Decodable<D> + PartialEq + Ord, V: Decodable<D>,

source§

impl<D: Decoder, K, V, S> Decodable<D> for HashMap<K, V, S>
where K: Decodable<D> + Hash + Eq, V: Decodable<D>, S: BuildHasher + Default,

source§

fn decode(d: &mut D) -> HashMap<K, V, S>

source§

impl<D: Decoder, K, V, S> Decodable<D> for IndexMap<K, V, S>
where K: Decodable<D> + Hash + Eq, V: Decodable<D>, S: BuildHasher + Default,

source§

fn decode(d: &mut D) -> IndexMap<K, V, S>

source§

impl<D: Decoder, T0: Decodable<D>, T1: Decodable<D>, T2: Decodable<D>, T3: Decodable<D>, T4: Decodable<D>, T5: Decodable<D>, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T1: Decodable<D>, T2: Decodable<D>> Decodable<D> for Result<T1, T2>

source§

fn decode(d: &mut D) -> Result<T1, T2>

source§

impl<D: Decoder, T1: Decodable<D>, T2: Decodable<D>, T3: Decodable<D>, T4: Decodable<D>, T5: Decodable<D>, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T2: Decodable<D>, T3: Decodable<D>, T4: Decodable<D>, T5: Decodable<D>, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T3: Decodable<D>, T4: Decodable<D>, T5: Decodable<D>, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T4: Decodable<D>, T5: Decodable<D>, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T5: Decodable<D>, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T5, T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T6: Decodable<D>, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T6, T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T7: Decodable<D>, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T7, T8, T9, T10, T11)

source§

impl<D: Decoder, T8: Decodable<D>, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T8, T9, T10, T11)

source§

impl<D: Decoder, T9: Decodable<D>, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T9, T10, T11)

source§

impl<D: Decoder, T10: Decodable<D>, T11: Decodable<D>> Decodable<D> for (T10, T11)

source§

impl<D: Decoder, T11: Decodable<D>> Decodable<D> for (T11,)

source§

impl<D: Decoder, T> Decodable<D> for BTreeSet<T>
where T: Decodable<D> + PartialEq + Ord,

source§

impl<D: Decoder, T> Decodable<D> for PhantomData<T>

source§

impl<D: Decoder, T, S> Decodable<D> for HashSet<T, S>
where T: Decodable<D> + Hash + Eq, S: BuildHasher + Default,

source§

fn decode(d: &mut D) -> HashSet<T, S>

source§

impl<D: Decoder, T, S> Decodable<D> for IndexSet<T, S>
where T: Decodable<D> + Hash + Eq, S: BuildHasher + Default,

source§

impl<D: Decoder, T: Decodable<D> + ToOwned> Decodable<D> for Cow<'static, [T]>
where [T]: ToOwned<Owned = Vec<T>>,

source§

fn decode(d: &mut D) -> Cow<'static, [T]>

source§

impl<D: Decoder, T: Decodable<D> + Copy> Decodable<D> for Cell<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Option<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Box<[T]>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Box<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for VecDeque<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Rc<[T]>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Rc<T>

source§

fn decode(d: &mut D) -> Rc<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Arc<[T]>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Arc<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for Vec<T>

source§

default fn decode(d: &mut D) -> Vec<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for RefCell<T>

source§

impl<D: Decoder, T: Decodable<D>> Decodable<D> for ThinVec<T>

source§

impl<D: Decoder, const N: usize> Decodable<D> for [u8; N]

source§

fn decode(d: &mut D) -> [u8; N]

Implementors§