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 new() -> SpinOptions
pub const fn new() -> SpinOptions
Create default spin options (spin forever until halted)
Sourcepub const fn timeout_ms(self, ms: u64) -> SpinOptions
pub const fn timeout_ms(self, ms: u64) -> SpinOptions
Set a timeout duration
Sourcepub const fn spin_once() -> SpinOptions
pub const fn spin_once() -> SpinOptions
Only process one round of work (equivalent to spin_once)
Sourcepub const fn max_callbacks(self, n: usize) -> SpinOptions
pub const fn max_callbacks(self, n: usize) -> SpinOptions
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