Crate futures_time
source · [−]Expand description
Async time combinators
Deadlines and Boundaries
While time is the most common type to use as an event source, other sources
of events also exist. In order to enable this, all functions take a generic
of either Deadline or Boundary.
Deadlinerepresents a specific one-off event. Types which implementDeadlinearestd::time::InstantandFuture.Boundaryrepresents a range. Types which implementBoundaryareDuration, andStream.
Futures
task::sleepSleeps for the specified amount of time.Future::delayDelay execution for a specified time.Future::delay_untilDelay execution until the specified instant.Future::timeoutCancel the future if the execution takes longer than the specified time.Future::timeout_atCancel the future if the execution goes beyond the specified instant.
Streams
stream::intervalCreates a new stream that yields at a set interval.Stream::auditStream::bufferStream::debounceStream::delayDelay execution for a specified time.Stream::delay_untilDelay execution until the specified instant.Stream::sampleStream::throttleFilter out all items after the first for a specified time.Stream::timeoutCancel the stream if the execution takes longer than the specified time.Stream::timeout_atCancel the stream if the execution goes beyond the specified instant.