Struct rustc_metadata::rmeta::decoder::DecodeContext
source · pub(super) struct DecodeContext<'a, 'tcx> {
opaque: MemDecoder<'a>,
cdata: Option<CrateMetadataRef<'a>>,
blob: &'a MetadataBlob,
sess: Option<&'tcx Session>,
tcx: Option<TyCtxt<'tcx>>,
lazy_state: LazyState,
alloc_decoding_session: Option<AllocDecodingSession<'a>>,
}
Fields§
§opaque: MemDecoder<'a>
§cdata: Option<CrateMetadataRef<'a>>
§blob: &'a MetadataBlob
§sess: Option<&'tcx Session>
§tcx: Option<TyCtxt<'tcx>>
§lazy_state: LazyState
§alloc_decoding_session: Option<AllocDecodingSession<'a>>
Implementations§
source§impl<'a, 'tcx> DecodeContext<'a, 'tcx>
impl<'a, 'tcx> DecodeContext<'a, 'tcx>
fn tcx(&self) -> TyCtxt<'tcx>
pub fn blob(&self) -> &'a MetadataBlob
pub fn cdata(&self) -> CrateMetadataRef<'a>
fn map_encoded_cnum_to_current(&self, cnum: CrateNum) -> CrateNum
fn read_lazy_offset_then<T>(&mut self, f: impl Fn(NonZeroUsize) -> T) -> T
fn read_lazy<T>(&mut self) -> LazyValue<T>
fn read_lazy_array<T>(&mut self, len: usize) -> LazyArray<T>
fn read_lazy_table<I, T>(&mut self, len: usize) -> LazyTable<I, T>
pub fn read_raw_bytes(&mut self, len: usize) -> &[u8] ⓘ
Trait Implementations§
source§impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for CrateRoot
impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for CrateRoot
fn decode(__decoder: &mut DecodeContext<'__a, 'tcx>) -> Self
source§impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for IncoherentImpls
impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for IncoherentImpls
fn decode(__decoder: &mut DecodeContext<'__a, 'tcx>) -> Self
source§impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for LazyTables
impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for LazyTables
fn decode(__decoder: &mut DecodeContext<'__a, 'tcx>) -> Self
source§impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for ProcMacroData
impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for ProcMacroData
fn decode(__decoder: &mut DecodeContext<'__a, 'tcx>) -> Self
source§impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for TraitImpls
impl<'tcx, '__a> Decodable<DecodeContext<'__a, 'tcx>> for TraitImpls
fn decode(__decoder: &mut DecodeContext<'__a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for &'tcx [(Predicate<'tcx>, Span)]
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for &'tcx [(Predicate<'tcx>, Span)]
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for AttrId
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for AttrId
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> AttrId
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for CrateNum
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for CrateNum
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> CrateNum
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for DefIndex
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for DefIndex
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> DefIndex
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for DefPathHashMapRef<'static>
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for DefPathHashMapRef<'static>
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> DefPathHashMapRef<'static>
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for ExpnId
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for ExpnId
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> ExpnId
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for ExpnIndex
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for ExpnIndex
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> ExpnIndex
source§impl<'a, 'tcx, T> Decodable<DecodeContext<'a, 'tcx>> for LazyArray<T>
impl<'a, 'tcx, T> Decodable<DecodeContext<'a, 'tcx>> for LazyArray<T>
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Self
source§impl<'a, 'tcx, I: Idx, T> Decodable<DecodeContext<'a, 'tcx>> for LazyTable<I, T>
impl<'a, 'tcx, I: Idx, T> Decodable<DecodeContext<'a, 'tcx>> for LazyTable<I, T>
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Self
source§impl<'a, 'tcx, T> Decodable<DecodeContext<'a, 'tcx>> for LazyValue<T>
impl<'a, 'tcx, T> Decodable<DecodeContext<'a, 'tcx>> for LazyValue<T>
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for Span
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for Span
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Span
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for Symbol
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for Symbol
fn decode(d: &mut DecodeContext<'a, 'tcx>) -> Self
source§impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for SyntaxContext
impl<'a, 'tcx> Decodable<DecodeContext<'a, 'tcx>> for SyntaxContext
fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> SyntaxContext
source§impl<'a, 'tcx> Decoder for DecodeContext<'a, 'tcx>
impl<'a, 'tcx> Decoder for DecodeContext<'a, 'tcx>
fn read_u128(&mut self) -> u128
fn read_u64(&mut self) -> u64
fn read_u32(&mut self) -> u32
fn read_u16(&mut self) -> u16
fn read_u8(&mut self) -> u8
fn read_usize(&mut self) -> usize
fn read_i128(&mut self) -> i128
fn read_i64(&mut self) -> i64
fn read_i32(&mut self) -> i32
fn read_i16(&mut self) -> i16
fn read_i8(&mut self) -> i8
fn read_isize(&mut self) -> isize
fn read_bool(&mut self) -> bool
fn read_f64(&mut self) -> f64
fn read_f32(&mut self) -> f32
fn read_char(&mut self) -> char
fn read_str(&mut self) -> &str
fn read_raw_bytes(&mut self, len: usize) -> &[u8] ⓘ
source§impl<'a, 'tcx> TyDecoder for DecodeContext<'a, 'tcx>
impl<'a, 'tcx> TyDecoder for DecodeContext<'a, 'tcx>
const CLEAR_CROSS_CRATE: bool = true
type I = TyCtxt<'tcx>
fn interner(&self) -> Self::I
fn peek_byte(&self) -> u8
fn position(&self) -> usize
fn cached_ty_for_shorthand<F>(
&mut self,
shorthand: usize,
or_insert_with: F
) -> Ty<'tcx>where
F: FnOnce(&mut Self) -> Ty<'tcx>,
fn with_position<F, R>(&mut self, pos: usize, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn decode_alloc_id(&mut self) -> AllocId
fn positioned_at_shorthand(&self) -> bool
Auto Trait Implementations§
impl<'a, 'tcx> !RefUnwindSafe for DecodeContext<'a, 'tcx>
impl<'a, 'tcx> !Send for DecodeContext<'a, 'tcx>
impl<'a, 'tcx> !Sync for DecodeContext<'a, 'tcx>
impl<'a, 'tcx> Unpin for DecodeContext<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for DecodeContext<'a, 'tcx>
Blanket Implementations§
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: 96 bytes