Trait pliantdb_local::core::networking::ServerConnection[][src]

pub trait ServerConnection: Send + Sync {
#[must_use]    pub fn create_database<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        schema: Id
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn delete_database<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn list_databases<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Database, Global>, Error>> + 'async_trait + Send, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn list_available_schemas<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Id, Global>, Error>> + 'async_trait + Send, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Functions for interacting with a PliantDB server.

Required methods

#[must_use]pub fn create_database<'life0, 'life1, 'async_trait>(
    &'life0 self,
    name: &'life1 str,
    schema: Id
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a database named name using the schema::Id schema.

Errors

  • Error::InvalidDatabaseName: name must begin with an alphanumeric character ([a-zA-Z0-9]), and all remaining characters must be alphanumeric, a period (.), or a hyphen (-).
  • [Error::DatabaseNameAlreadyTaken]: name` was already used for a previous database name. Database names are case insensitive.

#[must_use]pub fn delete_database<'life0, 'life1, 'async_trait>(
    &'life0 self,
    name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Deletes a database named name.

Errors

  • Error::DatabaseNotFound: database name does not exist.
  • [Error::Core(core::Error::Io)]: an error occurred while deleting files.

#[must_use]pub fn list_databases<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Database, Global>, Error>> + 'async_trait + Send, Global>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Lists the databases on this server.

#[must_use]pub fn list_available_schemas<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Id, Global>, Error>> + 'async_trait + Send, Global>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Lists the schema::Ids on this server.

Loading content...

Implementors

Loading content...