Struct pliantdb_local::Storage [−][src]
A local, file-based database.
Fields
schema: Arc<Schematic>
The Schematic
of DB
.
Implementations
impl<DB> Storage<DB> where
DB: Schema,
[src]
DB: Schema,
pub async fn open_local<P: AsRef<Path> + Send>(
path: P,
configuration: &Configuration
) -> Result<Self, Error>
[src]
path: P,
configuration: &Configuration
) -> Result<Self, Error>
pub async fn for_each_in_view<F: FnMut(IVec, ViewEntry) -> Result<(), Error> + Send + Sync>(
&self,
view: &dyn Serialized,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy,
callback: F
) -> Result<(), Error>
[src]
&self,
view: &dyn Serialized,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy,
callback: F
) -> Result<(), Error>
Iterate over each view entry matching key
.
pub async fn for_each_view_entry<V: View, F: FnMut(IVec, ViewEntry) -> Result<(), Error> + Send + Sync>(
&self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy,
callback: F
) -> Result<(), Error>
[src]
&self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy,
callback: F
) -> Result<(), Error>
Iterate over each view entry matching key
.
pub async fn get_from_collection_id(
&self,
id: u64,
collection: &Id
) -> Result<Option<Document<'static>>, Error>
[src]
&self,
id: u64,
collection: &Id
) -> Result<Option<Document<'static>>, Error>
Retrieves document id
from the specified collection
.
pub async fn get_multiple_from_collection_id(
&self,
ids: &[u64],
collection: &Id
) -> Result<Vec<Document<'static>>, Error>
[src]
&self,
ids: &[u64],
collection: &Id
) -> Result<Vec<Document<'static>>, Error>
Retrieves document id
from the specified collection
.
pub async fn reduce_in_view(
&self,
view_name: &str,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy
) -> Result<Vec<u8>, Error>
[src]
&self,
view_name: &str,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy
) -> Result<Vec<u8>, Error>
Reduce view view_name
.
pub async fn grouped_reduce_in_view(
&self,
view_name: &str,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<Vec<u8>, Vec<u8>>>, Error>
[src]
&self,
view_name: &str,
key: Option<QueryKey<Vec<u8>>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<Vec<u8>, Vec<u8>>>, Error>
Reduce view view_name
, grouping by unique keys.
Trait Implementations
impl<DB> Clone for Storage<DB>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, DB> Connection for Storage<DB> where
DB: Schema,
[src]
DB: Schema,
fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction<'static>
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
transaction: Transaction<'static>
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get<'life0, 'async_trait, C: Collection>(
&'life0 self,
id: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
id: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn get_multiple<'life0, 'life1, 'async_trait, C: Collection>(
&'life0 self,
ids: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = Result<Vec<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
ids: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = Result<Vec<Document<'static>>, Error>> + Send + 'async_trait>> where
C: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list_executed_transactions<'life0, 'async_trait>(
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed<'static>>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed<'static>>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
#[must_use]fn query<'life0, 'async_trait, V: View>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<Map<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn query_with_docs<'life0, 'async_trait, V: View>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedDocument<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedDocument<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn reduce<'life0, 'async_trait, V: View>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<V::Value, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<V::Value, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn reduce_grouped<'life0, 'async_trait, V: View>(
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
key: Option<QueryKey<V::Key>>,
access_policy: AccessPolicy
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<V::Key, V::Value>>, Error>> + Send + 'async_trait>> where
Self: Sized,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn last_transaction_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn collection<C>(&'a self) -> Collection<'a, Self, C> where
C: 'static + Collection,
[src]
C: 'static + Collection,
#[must_use]pub fn insert<'life0, 'async_trait, C>(
&'life0 self,
contents: Vec<u8, Global>
) -> Pin<Box<dyn Future<Output = Result<Header, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
C: Collection + 'async_trait,
[src]
&'life0 self,
contents: Vec<u8, Global>
) -> Pin<Box<dyn Future<Output = Result<Header, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
C: Collection + 'async_trait,
#[must_use]pub fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
doc: &'life1 mut Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
doc: &'life1 mut Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
#[must_use]pub fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
doc: &'life1 Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
doc: &'life1 Document<'life2>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
#[must_use]pub fn view<V>(&self) -> View<'_, Self, V> where
V: View,
[src]
V: View,
impl<DB: Debug> Debug for Storage<DB>
[src]
Auto Trait Implementations
impl<DB> !RefUnwindSafe for Storage<DB>
impl<DB> Send for Storage<DB> where
DB: Send,
DB: Send,
impl<DB> Sync for Storage<DB> where
DB: Sync,
DB: Sync,
impl<DB> Unpin for Storage<DB> where
DB: Unpin,
DB: Unpin,
impl<DB> !UnwindSafe for Storage<DB>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,