pub struct LayeredTypeClassRegistry { /* private fields */ }Expand description
A layered typeclass registry that supports scoped instance introduction.
Useful for local instance declarations inside tactics or proofs.
Implementations§
Source§impl LayeredTypeClassRegistry
impl LayeredTypeClassRegistry
Sourcepub fn push_layer(&mut self)
pub fn push_layer(&mut self)
Push a new empty layer.
Sourcepub fn add_instance(&mut self, inst: Instance)
pub fn add_instance(&mut self, inst: Instance)
Register an instance in the top layer (or global if no layers).
Sourcepub fn find_instance(&self, class: &Name, ty: &Expr) -> Option<&Instance>
pub fn find_instance(&self, class: &Name, ty: &Expr) -> Option<&Instance>
Find an instance by searching from the top layer to global.
Sourcepub fn total_instances(&self) -> usize
pub fn total_instances(&self) -> usize
Total instance count across all layers.
Trait Implementations§
Source§impl Debug for LayeredTypeClassRegistry
impl Debug for LayeredTypeClassRegistry
Source§impl Default for LayeredTypeClassRegistry
impl Default for LayeredTypeClassRegistry
Source§fn default() -> LayeredTypeClassRegistry
fn default() -> LayeredTypeClassRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LayeredTypeClassRegistry
impl RefUnwindSafe for LayeredTypeClassRegistry
impl Send for LayeredTypeClassRegistry
impl Sync for LayeredTypeClassRegistry
impl Unpin for LayeredTypeClassRegistry
impl UnsafeUnpin for LayeredTypeClassRegistry
impl UnwindSafe for LayeredTypeClassRegistry
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