Struct rustc_metadata::rmeta::encoder::EncodeContext
source · pub(super) struct EncodeContext<'a, 'tcx> {Show 14 fields
opaque: FileEncoder,
tcx: TyCtxt<'tcx>,
feat: &'tcx Features,
tables: TableBuilders,
lazy_state: LazyState,
span_shorthands: FxHashMap<Span, usize>,
type_shorthands: FxHashMap<Ty<'tcx>, usize>,
predicate_shorthands: FxHashMap<PredicateKind<'tcx>, usize>,
interpret_allocs: FxIndexSet<AllocId>,
source_file_cache: (Lrc<SourceFile>, usize),
required_source_files: Option<FxIndexSet<usize>>,
is_proc_macro: bool,
hygiene_ctxt: &'a HygieneEncodeContext,
symbol_table: FxHashMap<Symbol, usize>,
}
Fields§
§opaque: FileEncoder
§tcx: TyCtxt<'tcx>
§feat: &'tcx Features
§tables: TableBuilders
§lazy_state: LazyState
§span_shorthands: FxHashMap<Span, usize>
§type_shorthands: FxHashMap<Ty<'tcx>, usize>
§predicate_shorthands: FxHashMap<PredicateKind<'tcx>, usize>
§interpret_allocs: FxIndexSet<AllocId>
§source_file_cache: (Lrc<SourceFile>, usize)
§required_source_files: Option<FxIndexSet<usize>>
§is_proc_macro: bool
§hygiene_ctxt: &'a HygieneEncodeContext
§symbol_table: FxHashMap<Symbol, usize>
Implementations§
source§impl<'a, 'tcx> EncodeContext<'a, 'tcx>
impl<'a, 'tcx> EncodeContext<'a, 'tcx>
fn emit_lazy_distance(&mut self, position: NonZeroUsize)
fn lazy<T: ParameterizedOverTcx, B: Borrow<T::Value<'tcx>>>( &mut self, value: B ) -> LazyValue<T>where T::Value<'tcx>: Encodable<EncodeContext<'a, 'tcx>>,
fn lazy_array<T: ParameterizedOverTcx, I: IntoIterator<Item = B>, B: Borrow<T::Value<'tcx>>>( &mut self, values: I ) -> LazyArray<T>where T::Value<'tcx>: Encodable<EncodeContext<'a, 'tcx>>,
fn encode_def_path_table(&mut self)
fn encode_def_path_hash_map(&mut self) -> LazyValue<DefPathHashMapRef<'static>>
fn encode_source_map(&mut self) -> LazyTable<u32, Option<LazyValue<SourceFile>>>
fn encode_crate_root(&mut self) -> LazyValue<CrateRoot>
source§impl<'a, 'tcx> EncodeContext<'a, 'tcx>
impl<'a, 'tcx> EncodeContext<'a, 'tcx>
fn encode_attrs(&mut self, def_id: LocalDefId)
fn encode_def_ids(&mut self)
fn encode_info_for_adt(&mut self, local_def_id: LocalDefId)
fn encode_info_for_mod(&mut self, local_def_id: LocalDefId)
fn encode_explicit_item_bounds(&mut self, def_id: DefId)
fn encode_info_for_assoc_item(&mut self, def_id: DefId)
fn encode_mir(&mut self)
fn encode_stability(&mut self, def_id: DefId)
fn encode_const_stability(&mut self, def_id: DefId)
fn encode_default_body_stability(&mut self, def_id: DefId)
fn encode_deprecation(&mut self, def_id: DefId)
fn encode_info_for_macro(&mut self, def_id: LocalDefId)
fn encode_native_libraries(&mut self) -> LazyArray<NativeLib>
fn encode_foreign_modules(&mut self) -> LazyArray<ForeignModule>
fn encode_hygiene( &mut self ) -> (LazyTable<u32, Option<LazyValue<SyntaxContextData>>>, LazyTable<ExpnIndex, Option<LazyValue<ExpnData>>>, LazyTable<ExpnIndex, Option<LazyValue<ExpnHash>>>)
fn encode_proc_macros(&mut self) -> Option<ProcMacroData>
fn encode_debugger_visualizers(&mut self) -> LazyArray<DebuggerVisualizerFile>
fn encode_crate_deps(&mut self) -> LazyArray<CrateDep>
fn encode_lib_features(&mut self) -> LazyArray<(Symbol, Option<Symbol>)>
fn encode_stability_implications(&mut self) -> LazyArray<(Symbol, Symbol)>
fn encode_diagnostic_items(&mut self) -> LazyArray<(Symbol, DefIndex)>
fn encode_lang_items(&mut self) -> LazyArray<(DefIndex, LangItem)>
fn encode_lang_items_missing(&mut self) -> LazyArray<LangItem>
fn encode_stripped_cfg_items(&mut self) -> LazyArray<StrippedCfgItem<DefIndex>>
fn encode_traits(&mut self) -> LazyArray<DefIndex>
sourcefn encode_impls(&mut self) -> LazyArray<TraitImpls>
fn encode_impls(&mut self) -> LazyArray<TraitImpls>
Encodes an index, mapping each trait to its (local) implementations.
fn encode_incoherent_impls(&mut self) -> LazyArray<IncoherentImpls>
fn encode_exported_symbols( &mut self, exported_symbols: &[(ExportedSymbol<'tcx>, SymbolExportInfo)] ) -> LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>
fn encode_dylib_dependency_formats( &mut self ) -> LazyArray<Option<LinkagePreference>>
Trait Implementations§
source§impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for CrateHeader
impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for CrateHeader
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)
source§impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for CrateRoot
impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for CrateRoot
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)
source§impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for IncoherentImpls
impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for IncoherentImpls
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)
source§impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for LazyTables
impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for LazyTables
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)
source§impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for ProcMacroData
impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for ProcMacroData
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)
source§impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for TraitImpls
impl<'tcx, '__a> Encodable<EncodeContext<'__a, 'tcx>> for TraitImpls
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for [u8]
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for [u8]
fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for CrateNum
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for CrateNum
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for DefIndex
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for DefIndex
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for DefPathHashMapRef<'tcx>
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for DefPathHashMapRef<'tcx>
fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for ExpnId
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for ExpnId
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for ExpnIndex
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for ExpnIndex
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx, T> Encodable<EncodeContext<'a, 'tcx>> for LazyArray<T>
impl<'a, 'tcx, T> Encodable<EncodeContext<'a, 'tcx>> for LazyArray<T>
fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx, I, T> Encodable<EncodeContext<'a, 'tcx>> for LazyTable<I, T>
impl<'a, 'tcx, I, T> Encodable<EncodeContext<'a, 'tcx>> for LazyTable<I, T>
fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx, T> Encodable<EncodeContext<'a, 'tcx>> for LazyValue<T>
impl<'a, 'tcx, T> Encodable<EncodeContext<'a, 'tcx>> for LazyValue<T>
fn encode(&self, e: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Span
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Span
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for SpanData
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for SpanData
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Symbol
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Symbol
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for SyntaxContext
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for SyntaxContext
fn encode(&self, s: &mut EncodeContext<'a, 'tcx>)
source§impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx>
impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx>
fn emit_usize(&mut self, value: usize)
fn emit_u128(&mut self, value: u128)
fn emit_u64(&mut self, value: u64)
fn emit_u32(&mut self, value: u32)
fn emit_u16(&mut self, value: u16)
fn emit_u8(&mut self, value: u8)
fn emit_isize(&mut self, value: isize)
fn emit_i128(&mut self, value: i128)
fn emit_i64(&mut self, value: i64)
fn emit_i32(&mut self, value: i32)
fn emit_i16(&mut self, value: i16)
fn emit_raw_bytes(&mut self, value: &[u8])
fn emit_i8(&mut self, v: i8)
fn emit_bool(&mut self, v: bool)
fn emit_char(&mut self, v: char)
fn emit_str(&mut self, v: &str)
fn emit_enum_variant<F>(&mut self, v_id: usize, f: F)where F: FnOnce(&mut Self),
source§impl<'a, 'tcx> TyEncoder for EncodeContext<'a, 'tcx>
impl<'a, 'tcx> TyEncoder for EncodeContext<'a, 'tcx>
const CLEAR_CROSS_CRATE: bool = true
type I = TyCtxt<'tcx>
fn position(&self) -> usize
fn type_shorthands(&mut self) -> &mut FxHashMap<Ty<'tcx>, usize>
fn predicate_shorthands(&mut self) -> &mut FxHashMap<PredicateKind<'tcx>, usize>
fn encode_alloc_id(&mut self, alloc_id: &AllocId)
Auto Trait Implementations§
impl<'a, 'tcx> !RefUnwindSafe for EncodeContext<'a, 'tcx>
impl<'a, 'tcx> !Send for EncodeContext<'a, 'tcx>
impl<'a, 'tcx> !Sync for EncodeContext<'a, 'tcx>
impl<'a, 'tcx> Unpin for EncodeContext<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for EncodeContext<'a, 'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2488 bytes