mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 12:35:05 +08: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…
Reference in New Issue
Block a user