pub enum MockTimeError {
ActiveWaiters,
MismatchedTimeline {
expected: u64,
actual: u64,
},
}Expand description
Error returned when a mock time control operation is rejected.
Mock time controls are usually infallible because tests advance time explicitly. Resetting elapsed time while a sleeper or deadline waiter is active would rewind the timeline underneath a blocked operation. Passing an instant from one timeline into another timeline would make a deadline refer to the wrong logical time source. Both cases are rejected instead of silently producing inconsistent deadline behavior.
Variants§
ActiveWaiters
The operation would reset a timeline while waiters are still registered.
MismatchedTimeline
The operation received an instant created by a different timeline.
Trait Implementations§
Source§impl Clone for MockTimeError
impl Clone for MockTimeError
Source§fn clone(&self) -> MockTimeError
fn clone(&self) -> MockTimeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MockTimeError
impl Debug for MockTimeError
Source§impl Display for MockTimeError
impl Display for MockTimeError
Source§impl Error for MockTimeError
impl Error for MockTimeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for MockTimeError
impl PartialEq for MockTimeError
Source§fn eq(&self, other: &MockTimeError) -> bool
fn eq(&self, other: &MockTimeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for MockTimeError
impl Eq for MockTimeError
impl StructuralPartialEq for MockTimeError
Auto Trait Implementations§
impl Freeze for MockTimeError
impl RefUnwindSafe for MockTimeError
impl Send for MockTimeError
impl Sync for MockTimeError
impl Unpin for MockTimeError
impl UnsafeUnpin for MockTimeError
impl UnwindSafe for MockTimeError
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