Skip to main content

RemoteAction

pub trait RemoteAction {
    // Required methods
    fn name(&self) -> &'static str;
    async fn execute(&self, server_ip: &IpAddr) -> Result<(), RemoteActionError>;
}
Expand description

Trait for remote actions that can be executed on a server via SSH

Remote actions are lightweight scripts that connect to a provisioned server via SSH to perform various operations such as:

  • Validating server state and configuration
  • Retrieving server information (hostname, installed packages, etc.)
  • Executing maintenance tasks (updates, cleanup, etc.)
  • Installing or configuring software components

Required Methods§

Source

fn name(&self) -> &'static str

Get the name of this action for logging purposes

Source

async fn execute(&self, server_ip: &IpAddr) -> Result<(), RemoteActionError>

Execute the action against the specified server

§Arguments
  • server_ip - The IP address of the server to execute the action on
§Returns
  • Ok(()) if the action executes successfully
  • Err(RemoteActionError) if the action fails or encounters an error

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§