[][src]Struct turingdb::TuringEngine

pub struct TuringEngine { /* fields omitted */ }

This engine handles data all database queries and in-memory keys and sled file locks

Structure

#[derive(Debug, Clone)]
pub struct TuringEngine {
    dbs: DashMap<OsString, Tdb>, // Repo<DatabaseName, Databases>
}

Implementations

impl TuringEngine[src]

pub fn new() -> TuringEngine[src]

Create a new in-memory repo

pub async fn repo_create<'_>(&'_ self) -> Result<DbOps>[src]

Create a repo

pub async fn is_empty<'_>(&'_ self) -> bool[src]

Check if the repository is empty

pub async fn repo_init<'_, '_>(&'_ self) -> Result<&'_ TuringEngine>[src]

Read a repo

pub async fn repo_drop<'_>(&'_ self) -> Result<DbOps>[src]

Drop a repository

pub async fn db_create<'_, '_>(&'_ self, db_name: &'_ str) -> Result<DbOps>[src]

Create a database

pub async fn db_drop<'_, '_>(&'_ self, db_name: &'_ str) -> Result<DbOps>[src]

Drop the database

pub async fn db_list<'_>(&'_ self) -> DbOps[src]

List all the databases in the repo

pub async fn doc_create<'_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str
) -> Result<DbOps>
[src]

Create a document

pub async fn doc_drop<'_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str
) -> Result<DbOps>
[src]

Drop a document

pub async fn doc_list<'_, '_>(&'_ self, db_name: &'_ str) -> DbOps[src]

List all fields in a document

pub async fn flush<'_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str
) -> Result<DbOps>
[src]

Flush all dirty I/O buffers from pagecache to disk. RECOMMENDED: Always use this function whenever you are building a networked server

pub async fn field_list<'_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str
) -> DbOps
[src]

List all fields in a document

pub async fn field_insert<'_, '_, '_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str,
    field_name: &'_ str,
    data: &'_ [u8]
) -> Result<DbOps>
[src]

Create a field with data

pub async fn field_get<'_, '_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str,
    field_name: &'_ str
) -> Result<DbOps>
[src]

Get a field

pub async fn field_remove<'_, '_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str,
    field_name: &'_ str
) -> Result<DbOps>
[src]

Drop a field

pub async fn field_modify<'_, '_, '_, '_, '_>(
    &'_ self,
    db_name: &'_ str,
    doc_name: &'_ str,
    field_name: &'_ str,
    field_value: &'_ [u8]
) -> Result<DbOps>
[src]

Update a field

Trait Implementations

impl Clone for TuringEngine[src]

impl Debug for TuringEngine[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.