pub struct Storage<K, Doc: Document> { /* private fields */ }Implementations§
source§impl<K, Doc> Storage<K, Doc>where
Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document,
K: Serialize + DeserializeOwned + PartialOrd + Ord + PartialEq + Eq + Hash + Clone + Send + Sync + 'static,
impl<K, Doc> Storage<K, Doc>where Doc: Serialize + DeserializeOwned + Clone + Send + 'static + Document, K: Serialize + DeserializeOwned + PartialOrd + Ord + PartialEq + Eq + Hash + Clone + Send + Sync + 'static,
pub async fn open<'a>(ops: Options<'a>) -> Result<Self, String>
sourcepub async fn subscribe(
&self,
sender: Sender<Event<K, Doc>>
) -> Result<(), SessionResult>
pub async fn subscribe( &self, sender: Sender<Event<K, Doc>> ) -> Result<(), SessionResult>
subscribe to Reporter
sourcepub async fn insert(&self, key: K, doc: Doc) -> Result<(), SessionResult>
pub async fn insert(&self, key: K, doc: Doc) -> Result<(), SessionResult>
insert to storage and persist to disk
sourcepub async fn remove(&self, key: K) -> Result<(), SessionResult>
pub async fn remove(&self, key: K) -> Result<(), SessionResult>
remove from storage and persist to disk
sourcepub fn range(
&self,
field_name: &str,
from: String,
to: String
) -> Vec<Ref<'_, K, Doc>>
pub fn range( &self, field_name: &str, from: String, to: String ) -> Vec<Ref<'_, K, Doc>>
fetch document by range hash_index
sourcepub fn lookup_by_index(&self, index_key: &str) -> Option<Ref<'_, K, Doc>>
pub fn lookup_by_index(&self, index_key: &str) -> Option<Ref<'_, K, Doc>>
lookup by hash_index
sourcepub fn lookup_by_tag(&self, tag: &str) -> Vec<Ref<'_, K, Doc>>
pub fn lookup_by_tag(&self, tag: &str) -> Vec<Ref<'_, K, Doc>>
lookup by tag
sourcepub fn fetch_view(&self, view_name: &str) -> Vec<Ref<'_, K, Doc>>
pub fn fetch_view(&self, view_name: &str) -> Vec<Ref<'_, K, Doc>>
fetch view
sourcepub fn iter_index(&self) -> Iter<'_, String, K>
pub fn iter_index(&self) -> Iter<'_, String, K>
return Iter (Safe for mutation)
return Iter (Safe for mutation)
pub fn collection_len(self) -> usize
Auto Trait Implementations§
impl<K, Doc> !RefUnwindSafe for Storage<K, Doc>
impl<K, Doc> Send for Storage<K, Doc>where Doc: Send, K: Send + Sync,
impl<K, Doc> Sync for Storage<K, Doc>where Doc: Send + Sync, K: Send + Sync,
impl<K, Doc> Unpin for Storage<K, Doc>
impl<K, Doc> !UnwindSafe for Storage<K, Doc>
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