Skip to main content

## RefDecodable

# Trait RefDecodable

Source

    pub trait RefDecodable<'tcx, D: TyDecoder<'tcx>>: PointeeSized {
        // 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

## 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<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for (ExportedSymbol<'tcx>, SymbolExportInfo)

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for InlineAsmTemplatePiece

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for Attribute

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for TokenStream

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for UnordMap<DefId, EarlyBinder<'tcx, Ty<'tcx>>>

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for UnordSet<LocalDefId>

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for IndexVec<Promoted, Body<'tcx>>

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for DefId

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for LocalDefId

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for Span

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for Ident

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for FxIndexMap<LocalDefId, DefinitionSiteHiddenType<'tcx>>

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for FxIndexSet<ItemLocalId>

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for DocLinkResMap

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [(ExportedSymbol<'tcx>, SymbolExportInfo)]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [(Clause<'tcx>, Span)]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [(PolyTraitRef<'tcx>, Span)]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [InlineAsmTemplatePiece]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Attribute]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [ImplSource<'tcx, ()>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Variance]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [TokenStream]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [UnordMap<DefId, EarlyBinder<'tcx, Ty<'tcx>>>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [UnordSet<LocalDefId>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [IndexVec<Promoted, Body<'tcx>>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [DefId]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [LocalDefId]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Span]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Spanned<MonoItem<'tcx>>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Ident]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [DeducedParamAttrs]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Body<'tcx>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [Graph]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [AdtDefData]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [TypeckResults<'tcx>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [FxIndexMap<LocalDefId, DefinitionSiteHiddenType<'tcx>>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [FxIndexSet<ItemLocalId>]

Source§

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

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for [DocLinkResMap]

Source§

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

## Implementors§

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for ImplSource<'tcx, ()>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for Variance

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for DeducedParamAttrs

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for Body<'tcx>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for Graph

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for AdtDefData

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for TypeckResults<'tcx>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<FieldIdx>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<LocalDefId>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<Pattern<'tcx>>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<Const<'tcx>>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<Ty<'tcx>>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<BoundVariableKind<'tcx>>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for List<PolyExistentialPredicate<'tcx>>

Source§

### impl<'tcx, D: TyDecoder<'tcx>> RefDecodable<'tcx, D> for ListWithCachedTypeInfo<Clause<'tcx>>