mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-09 00:00:08 +02:00
docs: replace some html links with rustdoc paths (#2381)
Included changes
- all simple references like `<type>.<name>.html` for these types
- enum
- fn
- struct
- trait
- type
- simple references for methods, like struct.DelayQueue.html#method.poll
Refs: #1473
This commit is contained in:
@@ -364,9 +364,9 @@
|
|||||||
//! +------------+--------------+
|
//! +------------+--------------+
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! [`LengthDelimitedCodec::new()`]: struct.LengthDelimitedCodec.html#method.new
|
//! [`LengthDelimitedCodec::new()`]: method@LengthDelimitedCodec::new
|
||||||
//! [`FramedRead`]: struct.FramedRead.html
|
//! [`FramedRead`]: struct@FramedRead
|
||||||
//! [`FramedWrite`]: struct.FramedWrite.html
|
//! [`FramedWrite`]: struct@FramedWrite
|
||||||
//! [`AsyncRead`]: ../../trait.AsyncRead.html
|
//! [`AsyncRead`]: ../../trait.AsyncRead.html
|
||||||
//! [`AsyncWrite`]: ../../trait.AsyncWrite.html
|
//! [`AsyncWrite`]: ../../trait.AsyncWrite.html
|
||||||
//! [`Encoder`]: ../trait.Encoder.html
|
//! [`Encoder`]: ../trait.Encoder.html
|
||||||
|
|||||||
+1
-1
@@ -280,7 +280,7 @@ pin_project_lite::pin_project! {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`poll_proceed`]: fn.poll_proceed.html
|
/// [`poll_proceed`]: fn@poll_proceed
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[allow(unreachable_pub, dead_code)]
|
#[allow(unreachable_pub, dead_code)]
|
||||||
pub struct CoopFuture<F> {
|
pub struct CoopFuture<F> {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ impl crate::stream::Stream for ReadDir {
|
|||||||
|
|
||||||
/// Entries returned by the [`ReadDir`] stream.
|
/// Entries returned by the [`ReadDir`] stream.
|
||||||
///
|
///
|
||||||
/// [`ReadDir`]: struct.ReadDir.html
|
/// [`ReadDir`]: struct@ReadDir
|
||||||
///
|
///
|
||||||
/// This is a specialized version of [`std::fs::DirEntry`] for usage from the
|
/// This is a specialized version of [`std::fs::DirEntry`] for usage from the
|
||||||
/// Tokio runtime.
|
/// Tokio runtime.
|
||||||
|
|||||||
+8
-8
@@ -138,20 +138,20 @@
|
|||||||
//! context of the Tokio runtime, as they require Tokio-specific features to
|
//! context of the Tokio runtime, as they require Tokio-specific features to
|
||||||
//! function. Calling these functions outside of a Tokio runtime will panic.
|
//! function. Calling these functions outside of a Tokio runtime will panic.
|
||||||
//!
|
//!
|
||||||
//! [input]: fn.stdin.html
|
//! [input]: fn@stdin
|
||||||
//! [output]: fn.stdout.html
|
//! [output]: fn@stdout
|
||||||
//! [error]: fn.stderr.html
|
//! [error]: fn@stderr
|
||||||
//!
|
//!
|
||||||
//! # `std` re-exports
|
//! # `std` re-exports
|
||||||
//!
|
//!
|
||||||
//! Additionally, [`Error`], [`ErrorKind`], and [`Result`] are re-exported
|
//! Additionally, [`Error`], [`ErrorKind`], and [`Result`] are re-exported
|
||||||
//! from `std::io` for ease of use.
|
//! from `std::io` for ease of use.
|
||||||
//!
|
//!
|
||||||
//! [`AsyncRead`]: trait.AsyncRead.html
|
//! [`AsyncRead`]: trait@AsyncRead
|
||||||
//! [`AsyncWrite`]: trait.AsyncWrite.html
|
//! [`AsyncWrite`]: trait@AsyncWrite
|
||||||
//! [`Error`]: struct.Error.html
|
//! [`Error`]: struct@Error
|
||||||
//! [`ErrorKind`]: enum.ErrorKind.html
|
//! [`ErrorKind`]: enum@ErrorKind
|
||||||
//! [`Result`]: type.Result.html
|
//! [`Result`]: type@Result
|
||||||
//! [`Read`]: std::io::Read
|
//! [`Read`]: std::io::Read
|
||||||
//! [`Write`]: std::io::Write
|
//! [`Write`]: std::io::Write
|
||||||
cfg_io_blocking! {
|
cfg_io_blocking! {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ cfg_io_driver! {
|
|||||||
/// [`AsyncRead`]: ../io/trait.AsyncRead.html
|
/// [`AsyncRead`]: ../io/trait.AsyncRead.html
|
||||||
/// [`AsyncWrite`]: ../io/trait.AsyncWrite.html
|
/// [`AsyncWrite`]: ../io/trait.AsyncWrite.html
|
||||||
/// [`mio::Evented`]: https://docs.rs/mio/0.6/mio/trait.Evented.html
|
/// [`mio::Evented`]: https://docs.rs/mio/0.6/mio/trait.Evented.html
|
||||||
/// [`Registration`]: struct.Registration.html
|
/// [`Registration`]: struct@Registration
|
||||||
/// [`TcpListener`]: ../net/struct.TcpListener.html
|
/// [`TcpListener`]: ../net/struct.TcpListener.html
|
||||||
/// [`clear_read_ready`]: #method.clear_read_ready
|
/// [`clear_read_ready`]: #method.clear_read_ready
|
||||||
/// [`clear_write_ready`]: #method.clear_write_ready
|
/// [`clear_write_ready`]: #method.clear_write_ready
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ cfg_io_std! {
|
|||||||
///
|
///
|
||||||
/// Created by the [`stdin`] function.
|
/// Created by the [`stdin`] function.
|
||||||
///
|
///
|
||||||
/// [`stdin`]: fn.stdin.html
|
/// [`stdin`]: fn@stdin
|
||||||
/// [`AsyncRead`]: trait.AsyncRead.html
|
/// [`AsyncRead`]: trait@AsyncRead
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Stdin {
|
pub struct Stdin {
|
||||||
std: Blocking<std::io::Stdin>,
|
std: Blocking<std::io::Stdin>,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ cfg_io_util! {
|
|||||||
///
|
///
|
||||||
/// This is an asynchronous version of [`std::io::empty`][std].
|
/// This is an asynchronous version of [`std::io::empty`][std].
|
||||||
///
|
///
|
||||||
/// [`empty`]: fn.empty.html
|
/// [`empty`]: fn@empty
|
||||||
/// [std]: std::io::empty
|
/// [std]: std::io::empty
|
||||||
pub struct Empty {
|
pub struct Empty {
|
||||||
_p: (),
|
_p: (),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ cfg_io_util! {
|
|||||||
///
|
///
|
||||||
/// This is an asynchronous version of [`std::io::Repeat`][std].
|
/// This is an asynchronous version of [`std::io::Repeat`][std].
|
||||||
///
|
///
|
||||||
/// [repeat]: fn.repeat.html
|
/// [repeat]: fn@repeat
|
||||||
/// [std]: std::io::Repeat
|
/// [std]: std::io::Repeat
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Repeat {
|
pub struct Repeat {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ cfg_tcp! {
|
|||||||
/// A TCP stream can either be created by connecting to an endpoint, via the
|
/// A TCP stream can either be created by connecting to an endpoint, via the
|
||||||
/// [`connect`] method, or by [accepting] a connection from a [listener].
|
/// [`connect`] method, or by [accepting] a connection from a [listener].
|
||||||
///
|
///
|
||||||
/// [`connect`]: struct.TcpStream.html#method.connect
|
/// [`connect`]: method@TcpStream::connect
|
||||||
/// [accepting]: struct.TcpListener.html#method.accept
|
/// [accepting]: method@super::TcpListener::accept
|
||||||
/// [listener]: struct.TcpListener.html
|
/// [listener]: struct@super::TcpListener
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ cfg_rt_core! {
|
|||||||
|
|
||||||
/// Set this [`ThreadContext`] as the current active [`ThreadContext`].
|
/// Set this [`ThreadContext`] as the current active [`ThreadContext`].
|
||||||
///
|
///
|
||||||
/// [`ThreadContext`]: struct.ThreadContext.html
|
/// [`ThreadContext`]: struct@ThreadContext
|
||||||
pub(crate) fn enter<F, R>(new: Handle, f: F) -> R
|
pub(crate) fn enter<F, R>(new: Handle, f: F) -> R
|
||||||
where
|
where
|
||||||
F: FnOnce() -> R,
|
F: FnOnce() -> R,
|
||||||
|
|||||||
@@ -270,8 +270,8 @@ use std::time::Duration;
|
|||||||
/// [timer]: crate::time
|
/// [timer]: crate::time
|
||||||
/// [mod]: index.html
|
/// [mod]: index.html
|
||||||
/// [`new`]: #method.new
|
/// [`new`]: #method.new
|
||||||
/// [`Builder`]: struct.Builder.html
|
/// [`Builder`]: struct@Builder
|
||||||
/// [`tokio::run`]: fn.run.html
|
/// [`tokio::run`]: fn@run
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Runtime {
|
pub struct Runtime {
|
||||||
/// Task executor
|
/// Task executor
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ pub(crate) struct ThreadPool {
|
|||||||
///
|
///
|
||||||
/// `Spawner` instances are obtained by calling [`ThreadPool::spawner`].
|
/// `Spawner` instances are obtained by calling [`ThreadPool::spawner`].
|
||||||
///
|
///
|
||||||
/// [`ThreadPool::spawner`]: struct.ThreadPool.html#method.spawner
|
/// [`ThreadPool::spawner`]: method@ThreadPool::spawner
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct Spawner {
|
pub(crate) struct Spawner {
|
||||||
shared: Arc<worker::Shared>,
|
shared: Arc<worker::Shared>,
|
||||||
|
|||||||
@@ -76,8 +76,8 @@
|
|||||||
//! case, the mutex will be unlocked. If the panic is caught, this might leave
|
//! case, the mutex will be unlocked. If the panic is caught, this might leave
|
||||||
//! the data protected by the mutex in an inconsistent state.
|
//! the data protected by the mutex in an inconsistent state.
|
||||||
//!
|
//!
|
||||||
//! [`Mutex`]: struct.Mutex.html
|
//! [`Mutex`]: struct@Mutex
|
||||||
//! [`MutexGuard`]: struct.MutexGuard.html
|
//! [`MutexGuard`]: struct@MutexGuard
|
||||||
use crate::coop::CoopFutureExt;
|
use crate::coop::CoopFutureExt;
|
||||||
use crate::sync::batch_semaphore as semaphore;
|
use crate::sync::batch_semaphore as semaphore;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use std::task::{Context, Poll, Waker};
|
|||||||
|
|
||||||
/// Sends a value to the associated `Receiver`.
|
/// Sends a value to the associated `Receiver`.
|
||||||
///
|
///
|
||||||
/// Instances are created by the [`channel`](fn.channel.html) function.
|
/// Instances are created by the [`channel`](fn@channel) function.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Sender<T> {
|
pub struct Sender<T> {
|
||||||
inner: Option<Arc<Inner<T>>>,
|
inner: Option<Arc<Inner<T>>>,
|
||||||
@@ -24,7 +24,7 @@ pub struct Sender<T> {
|
|||||||
|
|
||||||
/// Receive a value from the associated `Sender`.
|
/// Receive a value from the associated `Sender`.
|
||||||
///
|
///
|
||||||
/// Instances are created by the [`channel`](fn.channel.html) function.
|
/// Instances are created by the [`channel`](fn@channel) function.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Receiver<T> {
|
pub struct Receiver<T> {
|
||||||
inner: Option<Arc<Inner<T>>>,
|
inner: Option<Arc<Inner<T>>>,
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ const MAX_READS: usize = 10;
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Mutex`]: struct.Mutex.html
|
/// [`Mutex`]: struct@super::Mutex
|
||||||
/// [`RwLock`]: struct.RwLock.html
|
/// [`RwLock`]: struct@RwLock
|
||||||
/// [`RwLockReadGuard`]: struct.RwLockReadGuard.html
|
/// [`RwLockReadGuard`]: struct@RwLockReadGuard
|
||||||
/// [`RwLockWriteGuard`]: struct.RwLockWriteGuard.html
|
/// [`RwLockWriteGuard`]: struct@RwLockWriteGuard
|
||||||
/// [`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html
|
/// [`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html
|
||||||
/// [_write-preferring_]: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Priority_policies
|
/// [_write-preferring_]: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Priority_policies
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -83,7 +83,7 @@ pub struct RwLock<T> {
|
|||||||
/// This structure is created by the [`read`] method on
|
/// This structure is created by the [`read`] method on
|
||||||
/// [`RwLock`].
|
/// [`RwLock`].
|
||||||
///
|
///
|
||||||
/// [`read`]: struct.RwLock.html#method.read
|
/// [`read`]: method@RwLock::read
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RwLockReadGuard<'a, T> {
|
pub struct RwLockReadGuard<'a, T> {
|
||||||
permit: ReleasingPermit<'a, T>,
|
permit: ReleasingPermit<'a, T>,
|
||||||
@@ -96,8 +96,8 @@ pub struct RwLockReadGuard<'a, T> {
|
|||||||
/// This structure is created by the [`write`] and method
|
/// This structure is created by the [`write`] and method
|
||||||
/// on [`RwLock`].
|
/// on [`RwLock`].
|
||||||
///
|
///
|
||||||
/// [`write`]: struct.RwLock.html#method.write
|
/// [`write`]: method@RwLock::write
|
||||||
/// [`RwLock`]: struct.RwLock.html
|
/// [`RwLock`]: struct@RwLock
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RwLockWriteGuard<'a, T> {
|
pub struct RwLockWriteGuard<'a, T> {
|
||||||
permit: ReleasingPermit<'a, T>,
|
permit: ReleasingPermit<'a, T>,
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ use std::sync::{Arc, Mutex, RwLock, RwLockReadGuard, Weak};
|
|||||||
use std::task::Poll::{Pending, Ready};
|
use std::task::Poll::{Pending, Ready};
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
/// Receives values from the associated [`Sender`](struct.Sender.html).
|
/// Receives values from the associated [`Sender`](struct@Sender).
|
||||||
///
|
///
|
||||||
/// Instances are created by the [`channel`](fn.channel.html) function.
|
/// Instances are created by the [`channel`](fn@channel) function.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Receiver<T> {
|
pub struct Receiver<T> {
|
||||||
/// Pointer to the shared state
|
/// Pointer to the shared state
|
||||||
@@ -74,9 +74,9 @@ pub struct Receiver<T> {
|
|||||||
inner: Watcher,
|
inner: Watcher,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sends values to the associated [`Receiver`](struct.Receiver.html).
|
/// Sends values to the associated [`Receiver`](struct@Receiver).
|
||||||
///
|
///
|
||||||
/// Instances are created by the [`channel`](fn.channel.html) function.
|
/// Instances are created by the [`channel`](fn@channel) function.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Sender<T> {
|
pub struct Sender<T> {
|
||||||
shared: Weak<Shared<T>>,
|
shared: Weak<Shared<T>>,
|
||||||
@@ -172,8 +172,8 @@ const CLOSED: usize = 1;
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Sender`]: struct.Sender.html
|
/// [`Sender`]: struct@Sender
|
||||||
/// [`Receiver`]: struct.Receiver.html
|
/// [`Receiver`]: struct@Receiver
|
||||||
pub fn channel<T: Clone>(init: T) -> (Sender<T>, Receiver<T>) {
|
pub fn channel<T: Clone>(init: T) -> (Sender<T>, Receiver<T>) {
|
||||||
const VERSION_0: usize = 0;
|
const VERSION_0: usize = 0;
|
||||||
const VERSION_1: usize = 2;
|
const VERSION_1: usize = 2;
|
||||||
|
|||||||
@@ -105,9 +105,9 @@ cfg_rt_util! {
|
|||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html
|
/// [`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html
|
||||||
/// [local task set]: struct.LocalSet.html
|
/// [local task set]: struct@LocalSet
|
||||||
/// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on
|
/// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on
|
||||||
/// [`task::spawn_local`]: fn.spawn.html
|
/// [`task::spawn_local`]: fn@spawn_local
|
||||||
pub struct LocalSet {
|
pub struct LocalSet {
|
||||||
/// Current scheduler tick
|
/// Current scheduler tick
|
||||||
tick: Cell<u8>,
|
tick: Cell<u8>,
|
||||||
@@ -266,7 +266,7 @@ impl LocalSet {
|
|||||||
/// }).await;
|
/// }).await;
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
/// [`spawn_local`]: fn.spawn_local.html
|
/// [`spawn_local`]: fn@spawn_local
|
||||||
pub fn spawn_local<F>(&self, future: F) -> JoinHandle<F::Output>
|
pub fn spawn_local<F>(&self, future: F) -> JoinHandle<F::Output>
|
||||||
where
|
where
|
||||||
F: Future + 'static,
|
F: Future + 'static,
|
||||||
@@ -335,7 +335,7 @@ impl LocalSet {
|
|||||||
/// })
|
/// })
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`spawn_local`]: fn.spawn_local.html
|
/// [`spawn_local`]: fn@spawn_local
|
||||||
/// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on
|
/// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on
|
||||||
/// [in-place blocking]: ../blocking/fn.in_place.html
|
/// [in-place blocking]: ../blocking/fn.in_place.html
|
||||||
/// [`spawn_blocking`]: ../blocking/fn.spawn_blocking.html
|
/// [`spawn_blocking`]: ../blocking/fn.spawn_blocking.html
|
||||||
@@ -372,7 +372,7 @@ impl LocalSet {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`spawn_local`]: fn.spawn_local.html
|
/// [`spawn_local`]: fn@spawn_local
|
||||||
/// [awaiting the local set]: #awaiting-a-localset
|
/// [awaiting the local set]: #awaiting-a-localset
|
||||||
pub async fn run_until<F>(&self, future: F) -> F::Output
|
pub async fn run_until<F>(&self, future: F) -> F::Output
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ impl<T: 'static, F: Future> Future for TaskLocalFuture<T, F> {
|
|||||||
trait StaticLifetime: 'static {}
|
trait StaticLifetime: 'static {}
|
||||||
impl<T: 'static> StaticLifetime for T {}
|
impl<T: 'static> StaticLifetime for T {}
|
||||||
|
|
||||||
/// An error returned by [`LocalKey::try_with`](struct.LocalKey.html#method.try_with).
|
/// An error returned by [`LocalKey::try_with`](method@LocalKey::try_with).
|
||||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||||
pub struct AccessError {
|
pub struct AccessError {
|
||||||
_private: (),
|
_private: (),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//! See [`DelayQueue`] for more details.
|
//! See [`DelayQueue`] for more details.
|
||||||
//!
|
//!
|
||||||
//! [`DelayQueue`]: struct.DelayQueue.html
|
//! [`DelayQueue`]: struct@DelayQueue
|
||||||
|
|
||||||
use crate::time::wheel::{self, Wheel};
|
use crate::time::wheel::{self, Wheel};
|
||||||
use crate::time::{delay_until, Delay, Duration, Error, Instant};
|
use crate::time::{delay_until, Delay, Duration, Error, Instant};
|
||||||
@@ -114,7 +114,7 @@ use std::task::{self, Poll};
|
|||||||
///
|
///
|
||||||
/// [`insert`]: #method.insert
|
/// [`insert`]: #method.insert
|
||||||
/// [`insert_at`]: #method.insert_at
|
/// [`insert_at`]: #method.insert_at
|
||||||
/// [`Key`]: struct.Key.html
|
/// [`Key`]: struct@Key
|
||||||
/// [`Stream`]: https://docs.rs/futures/0.1/futures/stream/trait.Stream.html
|
/// [`Stream`]: https://docs.rs/futures/0.1/futures/stream/trait.Stream.html
|
||||||
/// [`poll`]: #method.poll
|
/// [`poll`]: #method.poll
|
||||||
/// [`Stream::poll`]: #method.poll
|
/// [`Stream::poll`]: #method.poll
|
||||||
@@ -148,7 +148,7 @@ pub struct DelayQueue<T> {
|
|||||||
///
|
///
|
||||||
/// Values are returned by [`DelayQueue::poll`].
|
/// Values are returned by [`DelayQueue::poll`].
|
||||||
///
|
///
|
||||||
/// [`DelayQueue::poll`]: struct.DelayQueue.html#method.poll
|
/// [`DelayQueue::poll`]: method@DelayQueue::poll
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Expired<T> {
|
pub struct Expired<T> {
|
||||||
/// The data stored in the queue
|
/// The data stored in the queue
|
||||||
@@ -166,8 +166,8 @@ pub struct Expired<T> {
|
|||||||
/// Instances of `Key` are returned by [`DelayQueue::insert`]. See [`DelayQueue`]
|
/// Instances of `Key` are returned by [`DelayQueue::insert`]. See [`DelayQueue`]
|
||||||
/// documentation for more details.
|
/// documentation for more details.
|
||||||
///
|
///
|
||||||
/// [`DelayQueue`]: struct.DelayQueue.html
|
/// [`DelayQueue`]: struct@DelayQueue
|
||||||
/// [`DelayQueue::insert`]: struct.DelayQueue.html#method.insert
|
/// [`DelayQueue::insert`]: method@DelayQueue::insert
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Key {
|
pub struct Key {
|
||||||
index: usize,
|
index: usize,
|
||||||
@@ -298,7 +298,7 @@ impl<T> DelayQueue<T> {
|
|||||||
/// [`poll`]: #method.poll
|
/// [`poll`]: #method.poll
|
||||||
/// [`remove`]: #method.remove
|
/// [`remove`]: #method.remove
|
||||||
/// [`reset`]: #method.reset
|
/// [`reset`]: #method.reset
|
||||||
/// [`Key`]: struct.Key.html
|
/// [`Key`]: struct@Key
|
||||||
/// [type]: #
|
/// [type]: #
|
||||||
pub fn insert_at(&mut self, value: T, when: Instant) -> Key {
|
pub fn insert_at(&mut self, value: T, when: Instant) -> Key {
|
||||||
assert!(self.slab.len() < MAX_ENTRIES, "max entries exceeded");
|
assert!(self.slab.len() < MAX_ENTRIES, "max entries exceeded");
|
||||||
@@ -406,7 +406,7 @@ impl<T> DelayQueue<T> {
|
|||||||
/// [`poll`]: #method.poll
|
/// [`poll`]: #method.poll
|
||||||
/// [`remove`]: #method.remove
|
/// [`remove`]: #method.remove
|
||||||
/// [`reset`]: #method.reset
|
/// [`reset`]: #method.reset
|
||||||
/// [`Key`]: struct.Key.html
|
/// [`Key`]: struct@Key
|
||||||
/// [type]: #
|
/// [type]: #
|
||||||
pub fn insert(&mut self, value: T, timeout: Duration) -> Key {
|
pub fn insert(&mut self, value: T, timeout: Duration) -> Key {
|
||||||
self.insert_at(value, Instant::now() + timeout)
|
self.insert_at(value, Instant::now() + timeout)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//! See [`Timeout`] documentation for more details.
|
//! See [`Timeout`] documentation for more details.
|
||||||
//!
|
//!
|
||||||
//! [`Timeout`]: struct.Timeout.html
|
//! [`Timeout`]: struct@Timeout
|
||||||
|
|
||||||
use crate::time::{delay_until, Delay, Duration, Instant};
|
use crate::time::{delay_until, Delay, Duration, Instant};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user