Struct rustc_query_impl::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,
}
Expand description
An encoder that can write to the incremental compilation cache.
Fields
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
Implementations
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,
impl<'a, 'tcx, E> Encodable<CacheEncoder<'a, 'tcx, E>> for SyntaxContext where
E: 'a + OpaqueEncoder,
impl<'a, 'tcx, E> Encodable<CacheEncoder<'a, 'tcx, E>> for CrateNum where
E: 'a + OpaqueEncoder,
impl<'a, 'tcx, E> Encodable<CacheEncoder<'a, 'tcx, E>> for CrateNum where
E: 'a + OpaqueEncoder,
impl<'a, 'tcx, E> Encodable<CacheEncoder<'a, 'tcx, E>> for DefIndex where
E: 'a + OpaqueEncoder,
impl<'a, 'tcx, E> Encodable<CacheEncoder<'a, 'tcx, E>> for DefIndex where
E: 'a + OpaqueEncoder,
fn emit_enum<F>(&mut self, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
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>,
fn emit_enum_variant_arg<F>(
&mut self,
_first: bool,
f: F
) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_struct<F>(&mut self, _no_fields: bool, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_struct_field<F>(
&mut self,
_f_name: &str,
_first: bool,
f: F
) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_tuple<F>(&mut self, _len: usize, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_tuple_arg<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_option<F>(&mut self, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_option_some<F>(&mut self, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_seq<F>(&mut self, len: usize, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_seq_elt<F>(&mut self, _idx: usize, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
fn emit_map<F>(&mut self, len: usize, f: F) -> Result<(), Self::Error> where
F: FnOnce(&mut Self) -> Result<(), Self::Error>,
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
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 312 bytes