reactive_graph_client/client/system/command/
mod.rs1use std::sync::Arc;
2
3use crate::client::error::CommandError;
4use crate::client::result::CommandResult;
5use crate::client::system::command::args::ExecuteCommandArgs;
6use reactive_graph_client::ReactiveGraphClient;
7
8pub(crate) mod args;
9
10pub(crate) async fn execute_command(client: &Arc<ReactiveGraphClient>, command_args: ExecuteCommandArgs) -> CommandResult {
11 match client.runtime().command().execute(command_args.command_name, None).await {
13 Ok(Some(result)) => Ok(result.into()),
14 Ok(None) => Err(CommandError::NoContent("Command executed without return value".to_string())),
15 Err(e) => Err(e.into()),
16 }
17}