rustc_serialize::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§