Struct incremental_query::Context
source · pub struct Context<'cx> {
pub storage: &'cx Storage,
/* private fields */
}
Expand description
The context is the most important part of incremental compilation, the structure through which queries are run and that caches query invocations.
Fields§
§storage: &'cx Storage
Implementations§
source§impl<'cx> Context<'cx>
impl<'cx> Context<'cx>
pub fn new(storage: &'cx Storage) -> Self
pub fn set_cache_enabled(&self, enabled: bool)
pub fn next_generation(&self)
sourcepub fn gc(self, new_storage: &Storage) -> Context<'_>
pub fn gc(self, new_storage: &Storage) -> Context<'_>
Garbage collect the context. Deletes unreachable notes. Reachability is evaluated based on “root” nodes.
Some queries are run as part of another query in the query system,
I like to call those queries that run “inside” the query system.
Other queries are run from “outside” the query system after you
created a new Context
and want to run your first query.
These outside queries are considered root queries, and any node reachable
from them is kept alive by gc
.
After this, all objects are allocated in new_storage
and you can delete
the old backing storage to actually save space.
Auto Trait Implementations§
impl<'cx> !Freeze for Context<'cx>
impl<'cx> !RefUnwindSafe for Context<'cx>
impl<'cx> !Send for Context<'cx>
impl<'cx> !Sync for Context<'cx>
impl<'cx> Unpin for Context<'cx>
impl<'cx> !UnwindSafe for Context<'cx>
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