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

pub(in ty::query::on_disk_cache) struct CacheEncoder<'a, 'tcx, E: OpaqueEncoder> {
    tcx: TyCtxt<'tcx>,
    encoder: &'a mut E,
    type_shorthands: FxHashMap<Ty<'tcx>, usize>,
    predicate_shorthands: FxHashMap<Predicate<'tcx>, usize>,
    interpret_allocs: FxIndexSet<AllocId>,
    source_map: CachingSourceMapView<'tcx>,
    file_to_file_index: FxHashMap<*const SourceFile, SourceFileIndex>,
    hygiene_context: &'a HygieneEncodeContext,
}

An encoder that can write the incr. comp. cache.

Fields

tcx: TyCtxt<'tcx>encoder: &'a mut Etype_shorthands: FxHashMap<Ty<'tcx>, usize>predicate_shorthands: FxHashMap<Predicate<'tcx>, usize>interpret_allocs: FxIndexSet<AllocId>source_map: CachingSourceMapView<'tcx>file_to_file_index: FxHashMap<*const SourceFile, SourceFileIndex>hygiene_context: &'a HygieneEncodeContext

Implementations

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

pub(in ty::query::on_disk_cache) fn source_file_index(
    &mut self,
    source_file: Lrc<SourceFile>
) -> SourceFileIndex
[src]

pub(in ty::query::on_disk_cache) 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, E> Encodable<CacheEncoder<'a, 'tcx, E>> for SyntaxContext where
    E: 'a + OpaqueEncoder
[src]

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

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

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

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

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

type Error = E::Error

impl<'a, 'tcx> FingerprintEncoder for CacheEncoder<'a, 'tcx, Encoder>[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]