pub struct RemoteManager { /* private fields */ }Expand description
Remote node manager
Implementations§
Source§impl RemoteManager
impl RemoteManager
Sourcepub fn get_config_path() -> Result<PathBuf>
pub fn get_config_path() -> Result<PathBuf>
Get the default configuration file path
Sourcepub fn load_config(&mut self) -> Result<()>
pub fn load_config(&mut self) -> Result<()>
Load remote nodes configuration from file
Sourcepub fn save_config(&self) -> Result<()>
pub fn save_config(&self) -> Result<()>
Save remote nodes configuration to file
Sourcepub fn add_node(&mut self, node: RemoteNode) -> Result<()>
pub fn add_node(&mut self, node: RemoteNode) -> Result<()>
Add a remote node
Sourcepub fn remove_node(&mut self, id: &str) -> Result<()>
pub fn remove_node(&mut self, id: &str) -> Result<()>
Remove a remote node
Sourcepub fn get_node(&self, id: &str) -> Option<&RemoteNode>
pub fn get_node(&self, id: &str) -> Option<&RemoteNode>
Get a remote node by ID
Sourcepub fn list_nodes(&self) -> Vec<&RemoteNode>
pub fn list_nodes(&self) -> Vec<&RemoteNode>
List all remote nodes
Sourcepub fn list_nodes_by_tag(&self, tag: &str) -> Vec<&RemoteNode>
pub fn list_nodes_by_tag(&self, tag: &str) -> Vec<&RemoteNode>
List nodes by tag
Sourcepub fn update_node(&mut self, id: &str, node: RemoteNode) -> Result<()>
pub fn update_node(&mut self, id: &str, node: RemoteNode) -> Result<()>
Update a remote node
Sourcepub async fn execute_command(
&self,
node_id: &str,
command: RemoteCommand,
) -> Result<RemoteCommandResult>
pub async fn execute_command( &self, node_id: &str, command: RemoteCommand, ) -> Result<RemoteCommandResult>
Execute a command on a remote node
Sourcepub async fn test_connection(&self, node_id: &str) -> Result<bool>
pub async fn test_connection(&self, node_id: &str) -> Result<bool>
Test connection to a remote node
Sourcepub async fn execute_on_multiple(
&self,
node_ids: &[String],
command: RemoteCommand,
) -> Result<Vec<RemoteCommandResult>>
pub async fn execute_on_multiple( &self, node_ids: &[String], command: RemoteCommand, ) -> Result<Vec<RemoteCommandResult>>
Execute command on multiple nodes
Sourcepub fn import_nodes(&mut self, path: &Path) -> Result<usize>
pub fn import_nodes(&mut self, path: &Path) -> Result<usize>
Import nodes from a configuration file
Sourcepub fn export_nodes(&self, path: &Path) -> Result<()>
pub fn export_nodes(&self, path: &Path) -> Result<()>
Export nodes to a configuration file
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RemoteManager
impl RefUnwindSafe for RemoteManager
impl Send for RemoteManager
impl Sync for RemoteManager
impl Unpin for RemoteManager
impl UnwindSafe for RemoteManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more