Struct pliantdb_local::Storage[][src]

pub struct Storage<DB> {
    pub schema: Arc<Schematic>,
    // some fields omitted
}

A local, file-based database.

Fields

schema: Arc<Schematic>

The Schematic of DB.

Implementations

impl<DB> Storage<DB> where
    DB: Schema
[src]

pub async fn open_local<P: AsRef<Path> + Send>(
    path: P,
    configuration: &Configuration
) -> Result<Self, Error>
[src]

Opens a local file as a pliantdb.

Panics

Panics if tokio::task::spawn_blocking fails

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]

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]

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]

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]

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]

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]

Reduce view view_name, grouping by unique keys.

Trait Implementations

impl<DB> Clone for Storage<DB>[src]

impl<'a, DB> Connection for Storage<DB> where
    DB: Schema
[src]

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

impl<DB> Sync for Storage<DB> where
    DB: Sync

impl<DB> Unpin for Storage<DB> where
    DB: Unpin

impl<DB> !UnwindSafe for Storage<DB>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,