mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +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;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct CustomSettings(pub(crate) InnerRawIndex);
|
||||
|
||||
impl CustomSettings {
|
||||
pub fn set<K, V>(&self, key: K, value: V) -> Result<(), rocksdb::Error>
|
||||
where K: AsRef<[u8]>,
|
||||
V: AsRef<[u8]>,
|
||||
{
|
||||
self.0.set(key, value)
|
||||
}
|
||||
impl Deref for CustomSettings {
|
||||
type Target = InnerRawIndex;
|
||||
|
||||
pub fn get<K, V>(&self, key: K) -> Result<Option<DBVector>, rocksdb::Error>
|
||||
where K: AsRef<[u8]>,
|
||||
{
|
||||
self.0.get(key)
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user