pub(crate) struct DeadlineQueue<'a> {
queue: VecDeque<DeadlineEntry<'a>>,
}
Fields§
§queue: VecDeque<DeadlineEntry<'a>>
Implementations§
Source§impl<'a> DeadlineQueue<'a>
impl<'a> DeadlineQueue<'a>
pub(crate) fn with_capacity(capacity: usize) -> Self
Sourcefn now(&self) -> Instant
fn now(&self) -> Instant
All calls to Instant::now
go through this wrapper method.
This makes it easier to find all places that read the current time.
pub(crate) fn push(&mut self, id: TestId, test: &'a CollectedTest)
Sourcepub(crate) fn read_channel_while_checking_deadlines<T>(
&mut self,
rx: &Receiver<T>,
is_running: impl Fn(TestId) -> bool,
on_deadline_passed: impl FnMut(TestId, &CollectedTest),
) -> Result<T, RecvError>
pub(crate) fn read_channel_while_checking_deadlines<T>( &mut self, rx: &Receiver<T>, is_running: impl Fn(TestId) -> bool, on_deadline_passed: impl FnMut(TestId, &CollectedTest), ) -> Result<T, RecvError>
Equivalent to rx.recv()
, except that if a test exceeds its deadline
during the wait, the given callback will also be called for that test.
fn next_deadline(&self) -> Option<Instant>
fn for_each_entry_past_deadline( &mut self, is_running: impl Fn(TestId) -> bool, on_deadline_passed: impl FnMut(TestId, &CollectedTest), )
Auto Trait Implementations§
impl<'a> Freeze for DeadlineQueue<'a>
impl<'a> RefUnwindSafe for DeadlineQueue<'a>
impl<'a> Send for DeadlineQueue<'a>
impl<'a> Sync for DeadlineQueue<'a>
impl<'a> Unpin for DeadlineQueue<'a>
impl<'a> UnwindSafe for DeadlineQueue<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes