Struct rustc_middle::ty::query::on_disk_cache::CacheEncoder[−][src]

pub struct CacheEncoder<'a, 'tcx, E: OpaqueEncoder> {
    tcx: TyCtxt<'tcx>,
    encoder: &'a mut E,
    type_shorthands: FxHashMap<Ty<'tcx>, usize>,
    predicate_shorthands: FxHashMap<PredicateKind<'tcx>, usize>,
    interpret_allocs: FxIndexSet<AllocId>,
    source_map: CachingSourceMapView<'tcx>,
    file_to_file_index: FxHashMap<*const SourceFile, SourceFileIndex>,
    hygiene_context: &'a HygieneEncodeContext,
    latest_foreign_def_path_hashes: UnhashMap<DefPathHash, RawDefId>,
}
Expand description

An encoder that can write to the incremental compilation cache.

Fields

tcx: TyCtxt<'tcx>encoder: &'a mut Etype_shorthands: FxHashMap<Ty<'tcx>, usize>predicate_shorthands: FxHashMap<PredicateKind<'tcx>, usize>interpret_allocs: FxIndexSet<AllocId>source_map: CachingSourceMapView<'tcx>file_to_file_index: FxHashMap<*const SourceFile, SourceFileIndex>hygiene_context: &'a HygieneEncodeContextlatest_foreign_def_path_hashes: UnhashMap<DefPathHash, RawDefId>

Implementations

impl<'a, 'tcx, E> CacheEncoder<'a, 'tcx, E> where
    E: 'a + OpaqueEncoder, 
[src]

fn source_file_index(&mut self, source_file: Lrc<SourceFile>) -> SourceFileIndex[src]

fn encode_tagged<T: Encodable<Self>, V: Encodable<Self>>(
    &mut self,
    tag: T,
    value: &V
) -> Result<(), E::Error>
[src]

Encode something with additional information that allows to do some sanity checks when decoding the data again. This method will first encode the specified tag, then the given value, then the number of bytes taken up by tag and value. On decoding, we can then verify that we get the expected tag and read the expected number of bytes.

Trait Implementations

impl<'a, 'tcx> Encodable<CacheEncoder<'a, 'tcx, FileEncoder>> for [u8][src]

fn encode(
    &self,
    e: &mut CacheEncoder<'a, 'tcx, FileEncoder>
) -> FileEncodeResult
[src]

impl<'a, 'tcx, E> Encoder for CacheEncoder<'a, 'tcx, E> where
    E: 'a + OpaqueEncoder, 
[src]

type Error = E::Error

fn emit_unit(&mut self) -> Result<(), Self::Error>[src]

fn emit_usize(&mut self, value: usize) -> Result<(), Self::Error>[src]

fn emit_u128(&mut self, value: u128) -> Result<(), Self::Error>[src]

fn emit_u64(&mut self, value: u64) -> Result<(), Self::Error>[src]

fn emit_u32(&mut self, value: u32) -> Result<(), Self::Error>[src]

fn emit_u16(&mut self, value: u16) -> Result<(), Self::Error>[src]

fn emit_u8(&mut self, value: u8) -> Result<(), Self::Error>[src]

fn emit_isize(&mut self, value: isize) -> Result<(), Self::Error>[src]

fn emit_i128(&mut self, value: i128) -> Result<(), Self::Error>[src]

fn emit_i64(&mut self, value: i64) -> Result<(), Self::Error>[src]

fn emit_i32(&mut self, value: i32) -> Result<(), Self::Error>[src]

fn emit_i16(&mut self, value: i16) -> Result<(), Self::Error>[src]

fn emit_i8(&mut self, value: i8) -> Result<(), Self::Error>[src]

fn emit_bool(&mut self, value: bool) -> Result<(), Self::Error>[src]

fn emit_f64(&mut self, value: f64) -> Result<(), Self::Error>[src]

fn emit_f32(&mut self, value: f32) -> Result<(), Self::Error>[src]

fn emit_char(&mut self, value: char) -> Result<(), Self::Error>[src]

fn emit_str(&mut self, value: &str) -> Result<(), Self::Error>[src]

fn emit_raw_bytes(&mut self, value: &[u8]) -> Result<(), Self::Error>[src]

fn emit_enum<F>(&mut self, _name: &str, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_enum_variant<F>(
    &mut self,
    _v_name: &str,
    v_id: usize,
    _len: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_enum_variant_arg<F>(
    &mut self,
    _a_idx: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_enum_struct_variant<F>(
    &mut self,
    v_name: &str,
    v_id: usize,
    len: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_enum_struct_variant_field<F>(
    &mut self,
    _f_name: &str,
    f_idx: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_struct<F>(
    &mut self,
    _name: &str,
    _len: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_struct_field<F>(
    &mut self,
    _f_name: &str,
    _f_idx: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_tuple<F>(&mut self, _len: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_tuple_arg<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_tuple_struct<F>(
    &mut self,
    _name: &str,
    len: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_tuple_struct_arg<F>(
    &mut self,
    f_idx: usize,
    f: F
) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_option<F>(&mut self, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_option_none(&mut self) -> Result<(), Self::Error>[src]

fn emit_option_some<F>(&mut self, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_seq<F>(&mut self, len: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_seq_elt<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_map<F>(&mut self, len: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_map_elt_key<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

fn emit_map_elt_val<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error> where
    F: FnOnce(&mut Self) -> Result<(), Self::Error>, 
[src]

impl<'a, 'tcx, E> TyEncoder<'tcx> for CacheEncoder<'a, 'tcx, E> where
    E: 'a + OpaqueEncoder, 
[src]

const CLEAR_CROSS_CRATE: bool[src]

fn position(&self) -> usize[src]

fn type_shorthands(&mut self) -> &mut FxHashMap<Ty<'tcx>, usize>[src]

fn predicate_shorthands(&mut self) -> &mut FxHashMap<PredicateKind<'tcx>, usize>[src]

fn encode_alloc_id(&mut self, alloc_id: &AllocId) -> Result<(), Self::Error>[src]

Auto Trait Implementations

impl<'a, 'tcx, E> !RefUnwindSafe for CacheEncoder<'a, 'tcx, E>

impl<'a, 'tcx, E> !Send for CacheEncoder<'a, 'tcx, E>

impl<'a, 'tcx, E> !Sync for CacheEncoder<'a, 'tcx, E>

impl<'a, 'tcx, E> Unpin for CacheEncoder<'a, 'tcx, E>

impl<'a, 'tcx, E> !UnwindSafe for CacheEncoder<'a, 'tcx, E>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> MaybeResult<T> for T[src]

type Error = !

pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]

pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]