mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 13:40:31 +01:00
feat: Make more functions accessible on the custom settings
This commit is contained in:
parent
9fca74443e
commit
a147c09b06
@ -1,20 +1,13 @@
|
|||||||
use rocksdb::DBVector;
|
use std::ops::Deref;
|
||||||
use crate::database::raw_index::InnerRawIndex;
|
use crate::database::raw_index::InnerRawIndex;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct CustomSettings(pub(crate) InnerRawIndex);
|
pub struct CustomSettings(pub(crate) InnerRawIndex);
|
||||||
|
|
||||||
impl CustomSettings {
|
impl Deref for CustomSettings {
|
||||||
pub fn set<K, V>(&self, key: K, value: V) -> Result<(), rocksdb::Error>
|
type Target = InnerRawIndex;
|
||||||
where K: AsRef<[u8]>,
|
|
||||||
V: AsRef<[u8]>,
|
|
||||||
{
|
|
||||||
self.0.set(key, value)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get<K, V>(&self, key: K) -> Result<Option<DBVector>, rocksdb::Error>
|
fn deref(&self) -> &Self::Target {
|
||||||
where K: AsRef<[u8]>,
|
&self.0
|
||||||
{
|
|
||||||
self.0.get(key)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user