Skip to main content

FeedbackStream

Struct FeedbackStream 

Source
pub struct FeedbackStream<'a, A: RosAction, const GOAL_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const RESULT_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const FEEDBACK_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> { /* private fields */ }
Expand description

A stream of feedback messages from an action server.

Created by ActionClient::feedback_stream(). Receives feedback for all active goals. The stream never self-terminates — use combinators like take_while or break to stop.

Three access modes:

  • Async (Stream): Enable the stream feature for futures_core::Stream + StreamExt combinators
  • Async (no deps): Use next() in while let loops (always available)
  • Sync: Use wait_next() which drives the executor internally

Implementations§

Source§

impl<A: RosAction, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> FeedbackStream<'_, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

Source

pub async fn recv(&mut self) -> Option<Result<(GoalId, A::Feedback), NodeError>>

Async: wait for the next feedback message (no futures dependency needed).

Requires a background task running executor.spin_async() to drive I/O. Returns None only on error.

When the stream feature is enabled, prefer StreamExt::next() or TryStreamExt::try_next() for combinator support.

§Example
let mut stream = client.feedback_stream();
while let Some(result) = stream.recv().await {
    let (goal_id, feedback) = result?;
    // process feedback...
}
Source

pub fn wait_next( &mut self, executor: &mut Executor, timeout: Duration, ) -> Result<Option<(GoalId, A::Feedback)>, NodeError>

Sync: wait for the next feedback message, spinning the executor.

Returns Ok(Some(feedback)) if a message arrives within timeout_ms, or Ok(None) on timeout. Unlike Promise::wait(), timeout is not an error — the caller typically retries in a loop.

Auto Trait Implementations§

§

impl<'a, A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> Freeze for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<'a, A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> RefUnwindSafe for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
where A: RefUnwindSafe,

§

impl<'a, A, const GOAL_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const RESULT_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const FEEDBACK_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !Send for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<'a, A, const GOAL_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const RESULT_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const FEEDBACK_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !Sync for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<'a, A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> Unpin for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<'a, A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> UnsafeUnpin for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<'a, A, const GOAL_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const RESULT_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const FEEDBACK_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !UnwindSafe for FeedbackStream<'a, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

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.