#[non_exhaustive]pub struct SpinOptions {
pub only_next_available_work: bool,
pub timeout: Option<Duration>,
}
Expand description
A bundle of optional conditions that a user may want to impose on how long an executor spins for.
By default the executor will be allowed to spin indefinitely.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.only_next_available_work: bool
Only perform the next available work. This is similar to spin_once in rclcpp and rclpy.
To only process work that is immediately available without waiting at all, set a timeout of zero.
timeout: Option<Duration>
Stop waiting after this duration of time has passed. Use Some(0)
to not
wait any amount of time. Use None
to wait an infinite amount of time.
Implementations§
Trait Implementations§
Source§impl Default for SpinOptions
impl Default for SpinOptions
Source§fn default() -> SpinOptions
fn default() -> SpinOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpinOptions
impl RefUnwindSafe for SpinOptions
impl Send for SpinOptions
impl Sync for SpinOptions
impl Unpin for SpinOptions
impl UnwindSafe for SpinOptions
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