# Trait rustc_trait_selection::infer::canonical::ir::codec::RefDecodable

source ·

    pub trait RefDecodable<'tcx, D>where
        D: TyDecoder,{
        // Required method
        fn decode(d: &mut D) -> &'tcx Self;
    }

Expand description

Trait for decoding to a reference.

This is a separate trait from `Decodable` so that we can implement it for upstream types, such as `FxHashSet`.

The `TyDecodable` derive macro will use this trait for fields that are references (and don’t use a type alias to hide that).

`Decodable` can still be implemented in cases where `Decodable` is required by a trait bound.

## Required Methods§

source

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

## Object Safety§

This trait is not object safe.

## Implementors§