Trait bonsaidb::cli::CommandLine

source ·
pub trait CommandLine: Sized + Send + Sync {
    type Backend: Backend;
    type Subcommand: Subcommand + Send + Sync + Debug;

    // Required methods
    fn configuration<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<ServerConfiguration<Self::Backend>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 mut self,
        command: Self::Subcommand,
        connection: AnyServerConnection<Self::Backend>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn run<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait { ... }
    fn run_from<'async_trait, I, T>(
        self,
        itr: I
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where I: IntoIterator<Item = T> + Send + 'async_trait,
             T: Into<OsString> + Clone + Send + 'async_trait,
             Self: 'async_trait { ... }
    fn open_server<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<CustomServer<Self::Backend>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A command line interface that can be executed with either a remote or local connection to a server.

Required Associated Types§

source

type Backend: Backend

The Backend for this command line.

source

type Subcommand: Subcommand + Send + Sync + Debug

The [Subcommand] which is embedded next to the built-in BonsaiDb commands.

Required Methods§

source

fn configuration<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<ServerConfiguration<Self::Backend>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the server configuration to use when initializing a local server.

source

fn execute<'life0, 'async_trait>( &'life0 mut self, command: Self::Subcommand, connection: AnyServerConnection<Self::Backend> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Execute the command on connection.

Provided Methods§

source

fn run<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait,

Runs the command-line interface using command-line arguments from the environment.

source

fn run_from<'async_trait, I, T>( self, itr: I ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where I: IntoIterator<Item = T> + Send + 'async_trait, T: Into<OsString> + Clone + Send + 'async_trait, Self: 'async_trait,

Runs the command-line interface using the specified list of arguments.

source

fn open_server<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<CustomServer<Self::Backend>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns a new server initialized based on the same configuration used for CommandLine.

Implementors§