pub struct WaitOverride { /* private fields */ }Expand description
A partial WaitPolicy for one operation: unset fields are inherited.
§Examples
use std::time::Duration;
use threadteam::{Exec, Pool, WaitOverride};
let pool = Pool::builder().threads(2).acquire_timeout(std::time::Duration::from_secs(10)).build()?;
let mut exec = Exec::new(&pool, 2)?;
exec.team_with(WaitOverride::new().idle_spin(Duration::ZERO), |team| {
assert_eq!(team.policy().idle_spin(), Duration::ZERO);
})
.expect("an idle pool grants the team");Implementations§
Trait Implementations§
Source§impl Clone for WaitOverride
impl Clone for WaitOverride
impl Copy for WaitOverride
Source§impl Debug for WaitOverride
impl Debug for WaitOverride
Source§impl Default for WaitOverride
impl Default for WaitOverride
impl Eq for WaitOverride
Source§impl PartialEq for WaitOverride
impl PartialEq for WaitOverride
impl StructuralPartialEq for WaitOverride
Auto Trait Implementations§
impl Freeze for WaitOverride
impl RefUnwindSafe for WaitOverride
impl Send for WaitOverride
impl Sync for WaitOverride
impl Unpin for WaitOverride
impl UnsafeUnpin for WaitOverride
impl UnwindSafe for WaitOverride
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more