This repository has been archived on 2020-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
not-python-old.2020-08-27/src/obj/ctx.rs

32 lines
481 B
Rust
Raw Normal View History

use crate::{
mem::{gc::Gc, BasicGc},
obj::prelude::*,
};
pub type DefaultGc = BasicGc;
pub struct ObjCtx<'g, 'n, G>
where
G: Gc + 'g,
{
gc: &'g mut G,
ns: &'n mut Ns,
}
impl<'g, 'n, G> ObjCtx<'g, 'n, G>
where
G: Gc + 'g,
{
pub fn new(gc: &'g mut G, ns: &'n mut Ns) -> Self {
ObjCtx { gc, ns }
}
pub fn gc_mut(&'g mut self) -> &'g mut G {
self.gc
}
pub fn ns_mut(&'n mut self) -> &'n mut Ns {
self.ns
}
}