Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement Lookup #18

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fizikarubi
Copy link
Collaborator

Closes #11
Added a lookup module to extract the logic for searching Node in the database.

pub struct Lookup<'db, const D: usize, H: Hasher> {
    storage: Option<&'db NodeStorage<H>>,
    db: &'db dyn HashDBRef<H, DBValue>,
    root: &'db NodeHash<H>,
    null_nodes: &'db HashMap<H::Out, Node<H>>,
    recorder: Option<core::cell::RefCell<&'db mut dyn TreeRecorder<H>>>,
}

Note that the fields have to be the references to implement From<&TreeDB<'db, D, H>> and From<&TreeDBMut<'db, D, H>> for the Lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor lookup logic
1 participant