implements the index deletion, creation and swap

This commit is contained in:
Tamo 2022-09-07 21:27:06 +02:00 committed by Clément Renault
parent fa27485070
commit b1f0431ab4
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
4 changed files with 70 additions and 7 deletions

View file

@ -137,6 +137,13 @@ pub mod test {
}
}
pub fn delete(self) -> Result<()> {
match self {
MockIndex::Real(index) => index.delete(),
MockIndex::Mock(m) => unsafe { m.get("delete").call(()) },
}
}
pub fn perform_search(&self, query: SearchQuery) -> Result<SearchResult> {
match self {
MockIndex::Real(index) => index.perform_search(query),