pub struct TypeCache<'tcx> { /* private fields */ }Expand description
Provides a way to refer to a rustc_middle::ty::Ty via a handle that does not have a life time specifier.
Implementations§
source§impl<'tcx> TypeCache<'tcx>
impl<'tcx> TypeCache<'tcx>
pub fn new() -> TypeCache<'tcx>
sourcepub fn get_index(&mut self, ty: &Ty<'tcx>) -> usize
pub fn get_index(&mut self, ty: &Ty<'tcx>) -> usize
Returns a non zero index that can be used to retrieve ty via get_type.
sourcepub fn get_type(&self, index: usize) -> Option<Ty<'tcx>>
pub fn get_type(&self, index: usize) -> Option<Ty<'tcx>>
Returns the type that was stored at this index, or None if index is zero or greater than the length of the type list.
pub fn type_list(&self) -> &Vec<Ty<'tcx>>
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> !RefUnwindSafe for TypeCache<'tcx>
impl<'tcx> Send for TypeCache<'tcx>
impl<'tcx> Sync for TypeCache<'tcx>
impl<'tcx> Unpin for TypeCache<'tcx>
impl<'tcx> !UnwindSafe for TypeCache<'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more