pub struct SledStore { /* private fields */ }Implementations§
Source§impl SledStore
impl SledStore
Sourcepub fn new(path: impl AsRef<Path>) -> Result<Self, StoreError>
pub fn new(path: impl AsRef<Path>) -> Result<Self, StoreError>
§Errors
Returns an error if the database could not be opened.
Sourcepub fn new_temporary() -> Result<Self, StoreError>
pub fn new_temporary() -> Result<Self, StoreError>
§Errors
Returns an error if the temporary database could not be opened.
Trait Implementations§
Source§impl Store for SledStore
impl Store for SledStore
fn get_raw<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_raw<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn scan_prefix_raw<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<u8>)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for SledStore
impl !UnwindSafe for SledStore
impl Freeze for SledStore
impl Send for SledStore
impl Sync for SledStore
impl Unpin for SledStore
impl UnsafeUnpin for SledStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> StoreExt for T
impl<T> StoreExt for T
fn get<'life0, 'life1, 'async_trait, T>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, StoreError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Send,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, key: &'life1 str, value: &'life2 T, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
fn scan_prefix<'life0, 'life1, 'async_trait, T>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, T)>, StoreError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Send,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn scan_prefix_unsorted<'life0, 'life1, 'async_trait, T>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, T)>, StoreError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Send,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn scan_prefix_unsorted<'life0, 'life1, 'async_trait, T>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, T)>, StoreError>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Send,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sama seperti
scan_prefix tapi tidak melakukan sorting.
Cocok untuk path yang tidak membutuhkan urutan key.