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§
sourcetype Subcommand: Subcommand + Send + Sync + Debug
type Subcommand: Subcommand + Send + Sync + Debug
The [Subcommand
] which is embedded next to the built-in BonsaiDb
commands.
Required Methods§
sourcefn 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 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.
Provided Methods§
sourcefn run<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
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.
sourcefn run_from<'async_trait, I, T>(
self,
itr: I
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn run_from<'async_trait, I, T>( self, itr: I ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Runs the command-line interface using the specified list of arguments.
sourcefn 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,
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
.
Object Safety§
This trait is not object safe.