pub struct Command {
pub requester: ProductOSRequestClient,
pub node_url: Uri,
pub verify_key: Vec<u8>,
pub module: String,
pub instruction: String,
pub data: Option<Value>,
}Expand description
Command structure for executing commands on remote nodes.
This struct holds all the necessary information to execute a command on a remote Product OS node, including authentication and target details.
§Examples
let command = Command {
requester: ProductOSRequestClient::new(),
node_url: Uri::from_str("https://localhost:8443").unwrap(),
verify_key: vec![1, 2, 3, 4],
module: "status".to_string(),
instruction: "ping".to_string(),
data: None,
};Fields§
§requester: ProductOSRequestClientHTTP client for making requests
node_url: UriTarget node URL
verify_key: Vec<u8>Verification key for authentication
module: StringModule name to execute
instruction: StringInstruction/command name
data: Option<Value>Optional data payload
Implementations§
Source§impl Command
impl Command
Sourcepub async fn command(
&self,
) -> Result<ProductOSResponse<BodyBytes>, ProductOSRequestError>
pub async fn command( &self, ) -> Result<ProductOSResponse<BodyBytes>, ProductOSRequestError>
Execute this command on the target node.
Sends the command to the remote node and returns the response.
§Errors
Returns an error if the request fails or the node cannot be reached.
Auto Trait Implementations§
impl !Freeze for Command
impl !RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
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