Closed mre closed 4 years ago
Arbitrary value types ? Are you proposing something like:
populate<T: Hash>(keys: &Vec<T>) -> Box<Xor8>
Would be helpful to have a similar interface to HashSet or cuckoofilter eventually.
Xor8 Filter is immutable data structure, hence it is not possible to implement add() or delete() methods.
Xor8 Filter is immutable data structure, hence it is not possible to implement add() or delete() methods.
That's true. Was thinking of a builder pattern to provide the same API:
let mut builder = Xor8Builder::new();
builder.insert("A Dance With Dragons".to_string());
let books = builder.build() // This creates the immutable datastructure
insert
would be generic over T
:
pub fn insert(&mut self, value: T) -> bool {
todo!()
}
Using Xor filters instead of HashSet
would then require minimal code changes,
but I could understand if that design doesn't align with your goals for the crate.
I am open to pull request. We can create a separate Builder
type and implement a method into_xor8()
to obtain the immutable Xor8 value.
IMHO, any type which implement Hash trait could get u64
hash value, used as key for Xor filters.
Would like to know the feasibility of this solution.
Yes it is feasible ! Please check with @mre if you did like to take up this implementation.
Hey @uijin, if you want to give it a shot, go ahead. I like your idea lot.
Almost all of the feature requested is implemented. Documentation is added to publicly exposed API. Feel free to open separate issues for fixes and corrections.
Closing it.
Are you planning to add support for arbitrary value types like strings? Would be helpful to have a similar interface to HashSet or cuckoofilter eventually.
Use-case: I'm interested in testing XOR-filters as a search datastructure for tinysearch.