Struct ros2_client::action::AsyncActionServer

source ·
pub struct AsyncActionServer<A>{ /* private fields */ }

Implementations§

source§

impl<A> AsyncActionServer<A>

source

pub fn new(actionserver: ActionServer<A>) -> Self

source

pub fn get_new_goal( &self, handle: NewGoalHandle<A::GoalType> ) -> Option<&A::GoalType>

source

pub async fn receive_new_goal( &mut self ) -> ReadResult<NewGoalHandle<A::GoalType>>
where <A as ActionTypes>::GoalType: 'static,

Receive a new goal from an action client. Server should immediately either accept or reject the goal.

source

pub async fn accept_goal( &mut self, handle: NewGoalHandle<A::GoalType> ) -> Result<AcceptedGoalHandle<A::GoalType>, GoalError<()>>
where A::GoalType: 'static,

Convert a newly received goal into a accepted goal, i.e. accept it for execution later. Client will be notified of acceptance. Note: Once the goal is accepted, the server must eventually call .send_result_response() even if the goal is canceled or aborted.

source

pub async fn reject_goal( &mut self, handle: NewGoalHandle<A::GoalType> ) -> Result<(), GoalError<()>>
where A::GoalType: 'static,

Reject a received goal. Client will be notified of rejection. Server should not process the goal further.

source

pub async fn start_executing_goal( &mut self, handle: AcceptedGoalHandle<A::GoalType> ) -> Result<ExecutingGoalHandle<A::GoalType>, GoalError<()>>

Convert an accepted goal into a expecting goal, i.e. start the execution. Executing goal can publish feedback.

source

pub async fn publish_feedback( &mut self, handle: ExecutingGoalHandle<A::GoalType>, feedback: A::FeedbackType ) -> Result<(), GoalError<FeedbackMessage<A::FeedbackType>>>

Publish feedback on how the execution is proceeding.

source

pub async fn send_result_response( &mut self, handle: ExecutingGoalHandle<A::GoalType>, result_status: GoalEndStatus, result: A::ResultType ) -> Result<(), GoalError<()>>
where A::ResultType: 'static,

Notify Client that a goal end state was reached and what was the result of the action. This async will not resolve until the action client has requested for the result, but the client should request the result as soon as server accepts the goal.

source

pub async fn abort_executing_goal( &mut self, handle: ExecutingGoalHandle<A::GoalType> ) -> Result<(), GoalError<()>>

Abort goal execution, because action server has determined it cannot continue execution.

source

pub async fn abort_accepted_goal( &mut self, handle: AcceptedGoalHandle<A::GoalType> ) -> Result<(), GoalError<()>>

source

pub async fn receive_cancel_request(&self) -> ReadResult<CancelHandle>

Receive a set of cancel requests from the action client. The server should now respond either by accepting (some of) the cancel requests or rejecting all of them. The GoalIds that are requested to be cancelled can be currently at either accepted or executing state.

source

pub async fn respond_to_cancel_requests( &mut self, cancel_handle: &CancelHandle, goals_to_cancel: impl Iterator<Item = GoalId> ) -> WriteResult<(), ()>

Respond to action client’s cancel requests. The iterator of goals should list those GoalIds that will start canceling. For the other GoalIds, the cancel is not accepted and they do not change their state.

Auto Trait Implementations§

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>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V