Struct rupta::mir::context::ContextCache
source · pub struct ContextCache<E: ContextElement> { /* private fields */ }Expand description
Maintaing the contexts used.
Implementations§
source§impl<E: ContextElement> ContextCache<E>
impl<E: ContextElement> ContextCache<E>
pub fn new() -> ContextCache<E>
sourcepub fn get_context_id(&mut self, context: &Rc<Context<E>>) -> ContextId
pub fn get_context_id(&mut self, context: &Rc<Context<E>>) -> ContextId
Returns a non zero index that can be used to retrieve context via get_context.
sourcepub fn get_context(&self, id: ContextId) -> Option<Rc<Context<E>>>
pub fn get_context(&self, id: ContextId) -> Option<Rc<Context<E>>>
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 context_list(&self) -> &IndexVec<ContextId, Rc<Context<E>>>
Trait Implementations§
source§impl<E: Debug + ContextElement> Debug for ContextCache<E>
impl<E: Debug + ContextElement> Debug for ContextCache<E>
source§impl<E: ContextElement> Default for ContextCache<E>
impl<E: ContextElement> Default for ContextCache<E>
Auto Trait Implementations§
impl<E> RefUnwindSafe for ContextCache<E>where
E: RefUnwindSafe,
impl<E> !Send for ContextCache<E>
impl<E> !Sync for ContextCache<E>
impl<E> Unpin for ContextCache<E>
impl<E> UnwindSafe for ContextCache<E>where
E: RefUnwindSafe,
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