[][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 fn new() -> Self[src]

Initialize a new empty document

Usage

use crate::DocumentQuery;

Document::new()

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

Add a database name

Usage

use crate::DocumentQuery;

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

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

Add a document name

Usage

use crate::DocumentQuery;

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

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

Creates a new document in a database

Usage

use crate::DocumentQuery;

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

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

List all documents in a database

Usage

use crate::DocumentQuery;

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

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

Drops document in a database

Usage

use crate::DocumentQuery;

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

Trait Implementations

impl Clone for DocumentQuery[src]

impl Debug for DocumentQuery[src]

impl Default 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.