[][src]Struct turingdb_helpers::DocumentQuery

pub struct DocumentQuery { /* fields omitted */ }

Handles all queries releated to fields

#[derive(Debug, Serialize, Clone)]
pub struct DocumentQuery {
    db: String,
    document: Option<String>,
}

Implementations

impl DocumentQuery[src]

pub async fn new() -> Self[src]

Initialize a new empty document

Usage

use crate::DocumentQuery;

Document::new().await

pub async fn db<'_, '_, '_>(&'_ mut self, name: &'_ str) -> &'_ Self[src]

Add a database name

Usage

use crate::DocumentQuery;

let mut foo = DocumentQuery::new().await;
foo.db("db_name").await;

pub async fn document<'_, '_, '_>(&'_ mut self, name: &'_ str) -> &'_ Self[src]

Add a document name

Usage

use crate::DocumentQuery;

let mut foo = DocumentQuery::new().await;
foo
  .db("db_name").await
  .document("document_name").await;

pub async fn create<'_>(&'_ self) -> Result<Vec<u8>>[src]

Creates a new document in a database

Usage

use crate::DocumentQuery;

let mut foo = DocumentQuery::new().await;
foo
  .db("db_name").await
  .document("document_name").await
  .create().await

pub async fn list<'_>(&'_ self) -> Result<Vec<u8>>[src]

List all documents in a database

Usage

use crate::DocumentQuery;

let mut foo = DocumentQuery::new().await;
foo
  .db("db_name").await
  .list().await

pub async fn drop<'_>(&'_ self) -> Result<Vec<u8>>[src]

Drops document in a database

Usage

use crate::DocumentQuery;

let mut foo = DocumentQuery::new().await;
foo
  .db("db_name").await
  .document("document_name").await
  .drop().await

Trait Implementations

impl Clone for DocumentQuery[src]

impl Debug for DocumentQuery[src]

impl Serialize for DocumentQuery[src]

Auto Trait Implementations

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.