Skip to main content

EncodeFrom

Trait EncodeFrom 

Source
pub(super) trait EncodeFrom<'tcx, T> {
    // Required method
    fn encode_from<'a>(encoder: &mut EncodeContext<'a, 'tcx>, value: T) -> Self;
}
Expand description

Converts values from TyCtxt stored form into metadata table stored form

Required Methods§

Source

fn encode_from<'a>(encoder: &mut EncodeContext<'a, 'tcx>, value: T) -> Self

When a T is trivial to encode, it has a fixed size, no pointers inside, this can be just a no-op. For more complex types this usually creates a LazyValue<T> or LazyArray<T> encoding value with encoder in the process

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'tcx, T, B> EncodeFrom<'tcx, Option<B>> for Option<LazyValue<T>>
where T: ParameterizedOverTcx, T::Value<'tcx>: for<'b> Encodable<EncodeContext<'b, 'tcx>>, B: Borrow<T::Value<'tcx>>,

Source§

fn encode_from<'a>( encoder: &mut EncodeContext<'a, 'tcx>, value: Option<B>, ) -> Option<LazyValue<T>>

Source§

impl<'tcx> EncodeFrom<'tcx, Asyncness> for Asyncness

Source§

fn encode_from<'a>( _encoder: &mut EncodeContext<'a, 'tcx>, value: Asyncness, ) -> Asyncness

Source§

impl<'tcx> EncodeFrom<'tcx, Constness> for Constness

Source§

fn encode_from<'a>( _encoder: &mut EncodeContext<'a, 'tcx>, value: Constness, ) -> Constness

Source§

impl<'tcx> EncodeFrom<'tcx, CoroutineKind> for CoroutineKind

Source§

fn encode_from<'a>( _encoder: &mut EncodeContext<'a, 'tcx>, value: CoroutineKind, ) -> CoroutineKind

Source§

impl<'tcx> EncodeFrom<'tcx, DefKind> for DefKind

Source§

fn encode_from<'a>( _encoder: &mut EncodeContext<'a, 'tcx>, value: DefKind, ) -> DefKind

Source§

impl<'tcx> EncodeFrom<'tcx, Defaultness> for Defaultness

Source§

fn encode_from<'a>( _encoder: &mut EncodeContext<'a, 'tcx>, value: Defaultness, ) -> Defaultness

Source§

impl<'tcx> EncodeFrom<'tcx, Safety> for Safety

Source§

fn encode_from<'a>( _encoder: &mut EncodeContext<'a, 'tcx>, value: Safety, ) -> Safety

Source§

impl<'tcx> EncodeFrom<'tcx, bool> for bool

Source§

fn encode_from<'a>(_encoder: &mut EncodeContext<'a, 'tcx>, value: bool) -> bool

Source§

impl<'tcx> EncodeFrom<'tcx, u64> for u64

Source§

fn encode_from<'a>(_encoder: &mut EncodeContext<'a, 'tcx>, value: u64) -> u64

Implementors§

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<(ConstValue, Ty<'static>)>
where B: Borrow<(ConstValue, Ty<'tcx>)>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<AnonConstKind>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<AssocContainer>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<AsyncDestructor>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Body<'static>>
where B: Borrow<Body<'tcx>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<CodegenFnAttrs>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<CoerceUnsizedInfo>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ConstAllocation<'static>>
where B: Borrow<ConstAllocation<'tcx>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ConstConditions<'static>>
where B: Borrow<ConstConditions<'tcx>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ConstQualifs>
where B: Borrow<ConstQualifs>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ConstStability>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<CoroutineLayout<'static>>
where B: Borrow<CoroutineLayout<'tcx>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DefId>
where B: Borrow<DefId>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DefIdMap<EarlyBinder<'static, Ty<'static>>>>
where B: Borrow<UnordMap<DefId, EarlyBinder<TyCtxt<'tcx>, Ty<'tcx>>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DefIdMap<Vec<DefId>>>
where B: Borrow<UnordMap<DefId, Vec<DefId>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DefKey>
where B: Borrow<DefKey>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DefaultBodyStability>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DelimArgs>
where B: Borrow<DelimArgs>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DenseBitSet<u32>>
where B: Borrow<DenseBitSet<u32>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Deprecation>
where B: Borrow<Deprecation>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Destructor>
where B: Borrow<Destructor>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<DocLinkResMap>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<EarlyBinder<'static, Const<'static>>>
where B: Borrow<EarlyBinder<TyCtxt<'tcx>, Const<TyCtxt<'tcx>>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<EarlyBinder<'static, PolyFnSig<'static>>>
where B: Borrow<EarlyBinder<TyCtxt<'tcx>, Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<EarlyBinder<'static, Ty<'static>>>
where B: Borrow<EarlyBinder<TyCtxt<'tcx>, Ty<'tcx>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ExpnId>
where B: Borrow<ExpnId>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<GenericClauses<'static>>
where B: Borrow<GenericClauses<'tcx>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Generics>
where B: Borrow<Generics>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ImplTraitHeader<'static>>
where B: Borrow<ImplTraitHeader<'tcx>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ImplTraitInTraitData>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<IndexVec<FieldIdx, Symbol>>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<IndexVec<Promoted, Body<'static>>>
where B: Borrow<IndexVec<Promoted, Body<'tcx>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<IntrinsicDef>
where B: Borrow<IntrinsicDef>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ObjectLifetimeDefault>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<OpaqueTyOrigin<DefId>>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Option<EarlyBinder<'static, Const<'static>>>>
where B: Borrow<Option<EarlyBinder<TyCtxt<'tcx>, Const<TyCtxt<'tcx>>>>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<ReprOptions>
where B: Borrow<ReprOptions>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<RestrictionKind>

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Span>
where B: Borrow<Span>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Stability>
where B: Borrow<Stability>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<String>
where B: Borrow<String>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<TraitDef>
where B: Borrow<TraitDef>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<VariantData>
where B: Borrow<VariantData>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Vec<(usize, DenseBitSet<u32>)>>
where B: Borrow<Vec<(usize, DenseBitSet<u32>)>>,

Source§

impl<'tcx, B> EncodeFrom<'tcx, B> for LazyValue<Visibility<LocalDefId>>

Source§

impl<'tcx, T, I, B> EncodeFrom<'tcx, I> for LazyArray<T>
where T: ParameterizedOverTcx, I: IntoIterator<Item = B>, B: Borrow<T::Value<'tcx>>, T::Value<'tcx>: for<'a> Encodable<EncodeContext<'a, 'tcx>>,

Source§

impl<'tcx> EncodeFrom<'tcx, AttrFlags> for AttrFlags

Source§

impl<'tcx> EncodeFrom<'tcx, RemappedRawDefId> for RemappedRawDefId