pub struct MockRuntimeBuilder {
scheduling: SchedulingPolicy,
sleep: Option<SimpleMockTimeProvider>,
starting_wallclock: Option<SystemTime>,
}
Expand description
Builder for a manually-configured MockRuntime
Fields§
§scheduling: SchedulingPolicy
scheduling policy
sleep: Option<SimpleMockTimeProvider>
sleep provider
starting_wallclock: Option<SystemTime>
starting wall clock time
Implementations§
Source§impl MockRuntimeBuilder
impl MockRuntimeBuilder
Sourcepub fn scheduling(self, scheduling: SchedulingPolicy) -> Self
pub fn scheduling(self, scheduling: SchedulingPolicy) -> Self
Set the scheduling policy
Sourcepub fn sleep_provider(self, sleep: SimpleMockTimeProvider) -> Self
pub fn sleep_provider(self, sleep: SimpleMockTimeProvider) -> Self
Provide a non-Default
SimpleMockTimeProvider
Sourcepub fn starting_wallclock(self, starting_wallclock: SystemTime) -> Self
pub fn starting_wallclock(self, starting_wallclock: SystemTime) -> Self
Set the starting wall clock time
Sourcepub fn build(self) -> MockRuntime
pub fn build(self) -> MockRuntime
Build the runtime
Trait Implementations§
Source§impl Clone for MockRuntimeBuilder
impl Clone for MockRuntimeBuilder
Source§fn clone(&self) -> MockRuntimeBuilder
fn clone(&self) -> MockRuntimeBuilder
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 MockRuntimeBuilder
impl Debug for MockRuntimeBuilder
Source§impl Default for MockRuntimeBuilder
impl Default for MockRuntimeBuilder
Source§fn default() -> MockRuntimeBuilder
fn default() -> MockRuntimeBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockRuntimeBuilder
impl RefUnwindSafe for MockRuntimeBuilder
impl Send for MockRuntimeBuilder
impl Sync for MockRuntimeBuilder
impl Unpin for MockRuntimeBuilder
impl UnwindSafe for MockRuntimeBuilder
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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