pub struct BasicActionServer<G, F, R> { /* private fields */ }Implementations§
Source§impl<G, F, R> BasicActionServer<G, F, R>
impl<G, F, R> BasicActionServer<G, F, R>
pub fn new(action_name: impl Into<String>, schema: ActionSchema) -> Self
pub fn with_channel( action_name: impl Into<String>, schema: ActionSchema, channel: Arc<ActionChannel<G, F, R>>, ) -> Self
Sourcepub fn inject_goal(&mut self, goal_id: ActionGoalId, goal: G)
pub fn inject_goal(&mut self, goal_id: ActionGoalId, goal: G)
Test helper: inject a goal directly without going through the channel (standalone mode).
Trait Implementations§
Source§impl<G, F, R> ActionServer<G, F, R> for BasicActionServer<G, F, R>
impl<G, F, R> ActionServer<G, F, R> for BasicActionServer<G, F, R>
fn action_name(&self) -> &str
fn schema(&self) -> &ActionSchema
Source§fn recv_goal(&mut self) -> Result<Option<(ActionGoalId, G)>, RtError>
fn recv_goal(&mut self) -> Result<Option<(ActionGoalId, G)>, RtError>
Receive the next pending goal (FIFO). Read more
Source§fn accept_goal(&mut self, goal_id: ActionGoalId) -> Result<(), RtError>
fn accept_goal(&mut self, goal_id: ActionGoalId) -> Result<(), RtError>
Accept a goal; sends
GoalAck { accepted: true } to the client.Source§fn reject_goal(
&mut self,
goal_id: ActionGoalId,
reason: impl Into<String>,
) -> Result<(), RtError>
fn reject_goal( &mut self, goal_id: ActionGoalId, reason: impl Into<String>, ) -> Result<(), RtError>
Reject a goal; sends
GoalAck { accepted: false, reason } to the client.Source§fn publish_feedback(
&mut self,
goal_id: ActionGoalId,
feedback: F,
) -> Result<(), RtError>
fn publish_feedback( &mut self, goal_id: ActionGoalId, feedback: F, ) -> Result<(), RtError>
Push a feedback update to the client (may be called multiple times).
Source§fn heartbeat(&mut self, goal_id: ActionGoalId) -> Result<(), RtError>
fn heartbeat(&mut self, goal_id: ActionGoalId) -> Result<(), RtError>
Publish a keepalive heartbeat for a running goal.
Source§fn succeed(&mut self, goal_id: ActionGoalId, result: R) -> Result<(), RtError>
fn succeed(&mut self, goal_id: ActionGoalId, result: R) -> Result<(), RtError>
Mark the goal as succeeded and deliver the final result.
Source§fn fail(
&mut self,
goal_id: ActionGoalId,
reason: impl Into<String>,
) -> Result<(), RtError>
fn fail( &mut self, goal_id: ActionGoalId, reason: impl Into<String>, ) -> Result<(), RtError>
Mark the goal as failed and deliver the final result with an error reason.
Source§fn poll_cancel_request(&mut self) -> Option<ActionGoalId>
fn poll_cancel_request(&mut self) -> Option<ActionGoalId>
Poll for a pending cancel request from the client.
Source§fn confirm_cancel(&mut self, goal_id: ActionGoalId) -> Result<(), RtError>
fn confirm_cancel(&mut self, goal_id: ActionGoalId) -> Result<(), RtError>
Confirm that cancellation is complete; delivers a
GoalStatus::Canceled result.fn close(&mut self) -> Result<(), RtError>
Auto Trait Implementations§
impl<G, F, R> Freeze for BasicActionServer<G, F, R>
impl<G, F, R> RefUnwindSafe for BasicActionServer<G, F, R>
impl<G, F, R> Send for BasicActionServer<G, F, R>
impl<G, F, R> Sync for BasicActionServer<G, F, R>
impl<G, F, R> Unpin for BasicActionServer<G, F, R>
impl<G, F, R> UnsafeUnpin for BasicActionServer<G, F, R>
impl<G, F, R> UnwindSafe for BasicActionServer<G, F, R>
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