pub trait Oracle {
// Required methods
fn observe_cache_hit(&mut self, pageidx: PageIdx);
fn predict_next(
&mut self,
pageidx: PageIdx,
) -> impl Iterator<Item = PageIdx>;
}Required Methods§
Sourcefn observe_cache_hit(&mut self, pageidx: PageIdx)
fn observe_cache_hit(&mut self, pageidx: PageIdx)
observe_cache_hit is called whenever Graft satisfies a page read from
it’s local cache. This function is not called on a cache miss.
Sourcefn predict_next(&mut self, pageidx: PageIdx) -> impl Iterator<Item = PageIdx>
fn predict_next(&mut self, pageidx: PageIdx) -> impl Iterator<Item = PageIdx>
predict_next is called when Graft has a cache miss, and can be used to
hint that Graft should fetch additional pages along with the requested
page. The returned iterator should be empty if no additional pages
should be fetched, and it does not need to include the requested page.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.