pub(super) struct MetadataDecodeContext<'a, 'tcx> {
blob_decoder: BlobDecodeContext<'a>,
cdata: CrateMetadataRef<'a>,
tcx: TyCtxt<'tcx>,
alloc_decoding_session: AllocDecodingSession<'a>,
}Expand description
This is the decode context used when crate metadata was already read.
Decoding of some types, like Span require some information to already been read.
Can be constructed from a TyCtxt and CrateMetadataRef (see the Metadata trait)
Fields§
§blob_decoder: BlobDecodeContext<'a>§cdata: CrateMetadataRef<'a>§tcx: TyCtxt<'tcx>§alloc_decoding_session: AllocDecodingSession<'a>Implementations§
Source§impl<'a, 'tcx> MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> MetadataDecodeContext<'a, 'tcx>
fn map_encoded_cnum_to_current(&self, cnum: CrateNum) -> CrateNum
Methods from Deref<Target = BlobDecodeContext<'a>>§
pub(crate) fn blob(&self) -> &'a MetadataBlob
fn decode_symbol_or_byte_symbol<S>( &mut self, new_from_index: impl Fn(u32) -> S, read_and_intern_str_or_byte_str_this: impl Fn(&mut Self) -> S, read_and_intern_str_or_byte_str_opaque: impl Fn(&mut MemDecoder<'a>) -> S, ) -> S
Trait Implementations§
Source§impl<'a, 'tcx> BlobDecoder for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> BlobDecoder for MetadataDecodeContext<'a, 'tcx>
fn decode_def_index(&mut self) -> DefIndex
fn decode_symbol(&mut self) -> Symbol
fn decode_byte_symbol(&mut self) -> ByteSymbol
Source§impl<'a, 'tcx> Decodable<MetadataDecodeContext<'a, 'tcx>> for &'tcx [(Clause<'tcx>, Span)]
impl<'a, 'tcx> Decodable<MetadataDecodeContext<'a, 'tcx>> for &'tcx [(Clause<'tcx>, Span)]
fn decode(d: &mut MetadataDecodeContext<'a, 'tcx>) -> Self
Source§impl<'a, 'tcx> Decodable<MetadataDecodeContext<'a, 'tcx>> for ExpnIndex
impl<'a, 'tcx> Decodable<MetadataDecodeContext<'a, 'tcx>> for ExpnIndex
fn decode(d: &mut MetadataDecodeContext<'a, 'tcx>) -> ExpnIndex
Source§impl<'a, 'tcx> Decodable<MetadataDecodeContext<'a, 'tcx>> for SpanData
impl<'a, 'tcx> Decodable<MetadataDecodeContext<'a, 'tcx>> for SpanData
fn decode(decoder: &mut MetadataDecodeContext<'a, 'tcx>) -> SpanData
Source§impl<'a, 'tcx> Decoder for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> Decoder for MetadataDecodeContext<'a, 'tcx>
fn read_usize(&mut self) -> usize
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_isize(&mut self) -> isize
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_raw_bytes(&mut self, len: usize) -> &[u8] ⓘ
fn peek_byte(&self) -> u8
fn position(&self) -> usize
fn read_i8(&mut self) -> i8
fn read_bool(&mut self) -> bool
fn read_char(&mut self) -> char
fn read_str(&mut self) -> &str
fn read_byte_str(&mut self) -> &[u8] ⓘ
Source§impl<'a, 'tcx> Deref for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> Deref for MetadataDecodeContext<'a, 'tcx>
Source§impl<'a, 'tcx> DerefMut for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> DerefMut for MetadataDecodeContext<'a, 'tcx>
Source§impl<'a, 'tcx> LazyDecoder for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> LazyDecoder for MetadataDecodeContext<'a, 'tcx>
fn set_lazy_state(&mut self, state: LazyState)
fn get_lazy_state(&self) -> LazyState
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, width: usize, len: usize) -> LazyTable<I, T>
fn read_lazy_offset_then<T>(&mut self, f: impl Fn(NonZero<usize>) -> T) -> T
Source§impl<'a, 'tcx> SpanDecoder for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> SpanDecoder for MetadataDecodeContext<'a, 'tcx>
fn decode_attr_id(&mut self) -> AttrId
fn decode_crate_num(&mut self) -> CrateNum
fn decode_def_id(&mut self) -> DefId
fn decode_syntax_context(&mut self) -> SyntaxContext
fn decode_expn_id(&mut self) -> ExpnId
fn decode_span(&mut self) -> Span
Source§impl<'a, 'tcx> TyDecoder<'tcx> for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> TyDecoder<'tcx> for MetadataDecodeContext<'a, 'tcx>
const CLEAR_CROSS_CRATE: bool = true
fn interner(&self) -> TyCtxt<'tcx>
fn cached_ty_for_shorthand<F>( &mut self, shorthand: usize, or_insert_with: F, ) -> 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> !DynSend for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> !DynSync for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> Freeze for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> !RefUnwindSafe for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> !Send for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> !Sync for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> Unpin for MetadataDecodeContext<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for MetadataDecodeContext<'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
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 80 bytes