Skip to main content

BasicActionServer

Struct BasicActionServer 

Source
pub struct BasicActionServer<G, F, R> { /* private fields */ }

Implementations§

Source§

impl<G, F, R> BasicActionServer<G, F, R>

Source

pub fn new(action_name: impl Into<String>, schema: ActionSchema) -> Self

Source

pub fn with_channel( action_name: impl Into<String>, schema: ActionSchema, channel: Arc<ActionChannel<G, F, R>>, ) -> Self

Source

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>
where G: Send + 'static, F: Send + 'static, R: Send + 'static,

Source§

fn action_name(&self) -> &str

Source§

fn schema(&self) -> &ActionSchema

Source§

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>

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>

Reject a goal; sends GoalAck { accepted: false, reason } to the client.
Source§

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>

Publish a keepalive heartbeat for a running goal.
Source§

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>

Mark the goal as failed and deliver the final result with an error reason.
Source§

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>

Confirm that cancellation is complete; delivers a GoalStatus::Canceled result.
Source§

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>
where G: Send, F: Send, R: Send,

§

impl<G, F, R> Sync for BasicActionServer<G, F, R>
where G: Sync + Send, F: Sync + Send, R: Sync + Send,

§

impl<G, F, R> Unpin for BasicActionServer<G, F, R>
where G: Unpin, F: Unpin, R: Unpin,

§

impl<G, F, R> UnsafeUnpin for BasicActionServer<G, F, R>

§

impl<G, F, R> UnwindSafe for BasicActionServer<G, F, R>
where G: UnwindSafe, F: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.