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>,
}

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]

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

type Error = E::Error

impl<'a, 'tcx, E: OpaqueEncoder> FingerprintEncoder for CacheEncoder<'a, 'tcx, E>[src]

impl<'a, 'tcx, E> TyEncoder<'tcx> for CacheEncoder<'a, 'tcx, E> where
    E: 'a + OpaqueEncoder, 
[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]

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

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

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

impl<E> FingerprintEncoder for E where
    E: Encoder, 
[src]

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

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

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

type Error = !

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.

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.

impl<T> WithConstness for T[src]