pub struct SpinOptions {
pub timeout_ms: Option<u64>,
pub only_next: bool,
pub max_callbacks: Option<usize>,
}Expand description
Options controlling blocking spin behavior.
Used with Executor::spin_blocking
to control when the spin loop exits.
Fields§
§timeout_ms: Option<u64>Stop after this duration (in milliseconds)
only_next: boolOnly process immediately available work (single iteration)
max_callbacks: Option<usize>Stop after processing this many callbacks total
Implementations§
Source§impl SpinOptions
impl SpinOptions
Sourcepub const fn timeout_ms(self, ms: u64) -> Self
pub const fn timeout_ms(self, ms: u64) -> Self
Set a timeout duration
Sourcepub const fn max_callbacks(self, n: usize) -> Self
pub const fn max_callbacks(self, n: usize) -> Self
Stop after processing N callbacks
Trait Implementations§
Source§impl Clone for SpinOptions
impl Clone for SpinOptions
Source§fn clone(&self) -> SpinOptions
fn clone(&self) -> SpinOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpinOptions
impl Debug for SpinOptions
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 UnsafeUnpin 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