Trait TyEncoder

Source
pub trait TyEncoder<'tcx>: SpanEncoder {
    const CLEAR_CROSS_CRATE: bool;

    // Required methods
    fn position(&self) -> usize;
    fn type_shorthands(&mut self) -> &mut FxHashMap<Ty<'tcx>, usize>;
    fn predicate_shorthands(
        &mut self,
    ) -> &mut FxHashMap<PredicateKind<'tcx>, usize>;
    fn encode_alloc_id(&mut self, alloc_id: &AllocId);
}

Required Associated Constants§

Required Methods§

Source

fn position(&self) -> usize

Source

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

Source

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

Source

fn encode_alloc_id(&mut self, alloc_id: &AllocId)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, 'tcx> TyEncoder<'tcx> for CacheEncoder<'a, 'tcx>

impl<'a, 'tcx> TyEncoder<'tcx> for EncodeContext<'a, 'tcx>