flowistry_pdg_construction::encoder

Struct ParalegalDecoder

Source
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>

Source

pub fn new(tcx: TyCtxt<'tcx>, buf: &'a [u8]) -> Self

Decode what is in this buffer.

Source§

impl ParalegalDecoder<'_, '_>

Source

fn decode_file_name(&mut self, crate_num: CrateNum) -> Arc<SourceFile>

Source

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.

Source§

fn decode(d: &mut ParalegalDecoder<'tcx, 'a>) -> Self

Source§

impl Decoder for ParalegalDecoder<'_, '_>

Source§

fn read_usize(&mut self) -> usize

Source§

fn read_u128(&mut self) -> u128

Source§

fn read_u64(&mut self) -> u64

Source§

fn read_u32(&mut self) -> u32

Source§

fn read_u16(&mut self) -> u16

Source§

fn read_u8(&mut self) -> u8

Source§

fn read_isize(&mut self) -> isize

Source§

fn read_i128(&mut self) -> i128

Source§

fn read_i64(&mut self) -> i64

Source§

fn read_i32(&mut self) -> i32

Source§

fn read_i16(&mut self) -> i16

Source§

fn position(&self) -> usize

Source§

fn peek_byte(&self) -> u8

Source§

fn read_raw_bytes(&mut self, len: usize) -> &[u8]

Source§

fn read_i8(&mut self) -> i8

Source§

fn read_bool(&mut self) -> bool

Source§

fn read_char(&mut self) -> char

Source§

fn read_str(&mut self) -> &str

Source§

impl SpanDecoder for ParalegalDecoder<'_, '_>

Source§

impl<'tcx> TyDecoder for ParalegalDecoder<'tcx, '_>

Source§

const CLEAR_CROSS_CRATE: bool = true

Source§

type I = TyCtxt<'tcx>

Source§

fn interner(&self) -> Self::I

Source§

fn cached_ty_for_shorthand<F>( &mut self, shorthand: usize, or_insert_with: F, ) -> <Self::I as Interner>::Ty
where F: FnOnce(&mut Self) -> <Self::I as Interner>::Ty,

Source§

fn decode_alloc_id(&mut self) -> <Self::I as Interner>::AllocId

Source§

fn with_position<F, R>(&mut self, pos: usize, f: F) -> R
where 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Captures<'_> for T
where T: ?Sized,