pub struct ParalegalDecoder<'tcx, 'a> {
tcx: TyCtxt<'tcx>,
mem_decoder: MemDecoder<'a>,
shorthand_map: FxHashMap<usize, Ty<'tcx>>,
file_shorthands: FxHashMap<usize, Arc<SourceFile>>,
}
Expand description
Something that implements TyDecoder
.
Fields§
§tcx: TyCtxt<'tcx>
§mem_decoder: MemDecoder<'a>
§shorthand_map: FxHashMap<usize, Ty<'tcx>>
§file_shorthands: FxHashMap<usize, Arc<SourceFile>>
Implementations§
Source§impl<'tcx, 'a> ParalegalDecoder<'tcx, 'a>
impl<'tcx, 'a> ParalegalDecoder<'tcx, 'a>
Source§impl ParalegalDecoder<'_, '_>
impl ParalegalDecoder<'_, '_>
fn decode_file_name(&mut self, crate_num: CrateNum) -> Arc<SourceFile>
fn decode_filename_local(&mut self, crate_num: CrateNum) -> Arc<SourceFile>
Trait Implementations§
Source§impl<'tcx, 'a> Decodable<ParalegalDecoder<'tcx, 'a>> for SpanData
Partially uses code similar to DecodeContext
. But we fully encode file
names. We then map them back by searching the currently loaded files. If the
file we care about is not found there, we try and load its source.
impl<'tcx, 'a> Decodable<ParalegalDecoder<'tcx, 'a>> for SpanData
Partially uses code similar to DecodeContext
. But we fully encode file
names. We then map them back by searching the currently loaded files. If the
file we care about is not found there, we try and load its source.
fn decode(d: &mut ParalegalDecoder<'tcx, 'a>) -> Self
Source§impl Decoder for ParalegalDecoder<'_, '_>
impl Decoder for ParalegalDecoder<'_, '_>
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 position(&self) -> usize
fn peek_byte(&self) -> u8
fn read_raw_bytes(&mut self, len: usize) -> &[u8] ⓘ
fn read_i8(&mut self) -> i8
fn read_bool(&mut self) -> bool
fn read_char(&mut self) -> char
fn read_str(&mut self) -> &str
Source§impl SpanDecoder for ParalegalDecoder<'_, '_>
impl SpanDecoder for ParalegalDecoder<'_, '_>
fn decode_crate_num(&mut self) -> CrateNum
fn decode_def_index(&mut self) -> DefIndex
fn decode_span(&mut self) -> Span
fn decode_syntax_context(&mut self) -> SyntaxContext
fn decode_def_id(&mut self) -> DefId
fn decode_expn_id(&mut self) -> ExpnId
fn decode_symbol(&mut self) -> Symbol
fn decode_attr_id(&mut self) -> AttrId
Source§impl<'tcx> TyDecoder for ParalegalDecoder<'tcx, '_>
impl<'tcx> TyDecoder for ParalegalDecoder<'tcx, '_>
const CLEAR_CROSS_CRATE: bool = true
type I = TyCtxt<'tcx>
fn interner(&self) -> Self::I
fn cached_ty_for_shorthand<F>(
&mut self,
shorthand: usize,
or_insert_with: F,
) -> <Self::I as Interner>::Tywhere
F: FnOnce(&mut Self) -> <Self::I as Interner>::Ty,
fn decode_alloc_id(&mut self) -> <Self::I as Interner>::AllocId
fn with_position<F, R>(&mut self, pos: usize, f: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn positioned_at_shorthand(&self) -> bool
Auto Trait Implementations§
impl<'tcx, 'a> Freeze for ParalegalDecoder<'tcx, 'a>
impl<'tcx, 'a> !RefUnwindSafe for ParalegalDecoder<'tcx, 'a>
impl<'tcx, 'a> !Send for ParalegalDecoder<'tcx, 'a>
impl<'tcx, 'a> !Sync for ParalegalDecoder<'tcx, 'a>
impl<'tcx, 'a> Unpin for ParalegalDecoder<'tcx, 'a>
impl<'tcx, 'a> !UnwindSafe for ParalegalDecoder<'tcx, 'a>
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> 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 more