pub struct RemoteAgentClient {
pub node_id: NodeId,
/* private fields */
}Expand description
Client for remote agents to report progress
Fields§
§node_id: NodeIdNode ID this client represents
Implementations§
Source§impl RemoteAgentClient
impl RemoteAgentClient
Sourcepub fn new(node_id: impl Into<String>, server_url: impl Into<String>) -> Self
pub fn new(node_id: impl Into<String>, server_url: impl Into<String>) -> Self
Create a new remote agent client
Sourcepub async fn heartbeat(&self) -> Result<(), RemoteMonitorError>
pub async fn heartbeat(&self) -> Result<(), RemoteMonitorError>
Send heartbeat
Sourcepub async fn report_progress(
&self,
task_id: &str,
progress: f32,
message: Option<&str>,
) -> Result<(), RemoteMonitorError>
pub async fn report_progress( &self, task_id: &str, progress: f32, message: Option<&str>, ) -> Result<(), RemoteMonitorError>
Report task progress
Sourcepub async fn report_step(
&self,
task_id: &str,
step: u32,
total: u32,
description: Option<&str>,
) -> Result<(), RemoteMonitorError>
pub async fn report_step( &self, task_id: &str, step: u32, total: u32, description: Option<&str>, ) -> Result<(), RemoteMonitorError>
Report task step
Sourcepub async fn report_completed(
&self,
task_id: &str,
result: TaskResult,
) -> Result<(), RemoteMonitorError>
pub async fn report_completed( &self, task_id: &str, result: TaskResult, ) -> Result<(), RemoteMonitorError>
Report task completion
Sourcepub async fn report_failed(
&self,
task_id: &str,
error: &str,
) -> Result<(), RemoteMonitorError>
pub async fn report_failed( &self, task_id: &str, error: &str, ) -> Result<(), RemoteMonitorError>
Report task failure
Auto Trait Implementations§
impl Freeze for RemoteAgentClient
impl !RefUnwindSafe for RemoteAgentClient
impl Send for RemoteAgentClient
impl Sync for RemoteAgentClient
impl Unpin for RemoteAgentClient
impl !UnwindSafe for RemoteAgentClient
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