mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
Merge pull request #258 from alex/patch-1
Fixed docs for Timeout::new and new_at
This commit is contained in:
@@ -27,8 +27,8 @@ pub struct Timeout {
|
|||||||
impl Timeout {
|
impl Timeout {
|
||||||
/// Creates a new timeout which will fire at `dur` time into the future.
|
/// Creates a new timeout which will fire at `dur` time into the future.
|
||||||
///
|
///
|
||||||
/// This function will return a future that will resolve to the actual
|
/// This function will return a Result with the actual timeout object or an
|
||||||
/// timeout object. The timeout object itself is then a future which will be
|
/// error. The timeout object itself is then a future which will be
|
||||||
/// set to fire at the specified point in the future.
|
/// set to fire at the specified point in the future.
|
||||||
pub fn new(dur: Duration, handle: &Handle) -> io::Result<Timeout> {
|
pub fn new(dur: Duration, handle: &Handle) -> io::Result<Timeout> {
|
||||||
Timeout::new_at(Instant::now() + dur, handle)
|
Timeout::new_at(Instant::now() + dur, handle)
|
||||||
@@ -36,8 +36,8 @@ impl Timeout {
|
|||||||
|
|
||||||
/// Creates a new timeout which will fire at the time specified by `at`.
|
/// Creates a new timeout which will fire at the time specified by `at`.
|
||||||
///
|
///
|
||||||
/// This function will return a future that will resolve to the actual
|
/// This function will return a Result with the actual timeout object or an
|
||||||
/// timeout object. The timeout object itself is then a future which will be
|
/// error. The timeout object itself is then a future which will be
|
||||||
/// set to fire at the specified point in the future.
|
/// set to fire at the specified point in the future.
|
||||||
pub fn new_at(at: Instant, handle: &Handle) -> io::Result<Timeout> {
|
pub fn new_at(at: Instant, handle: &Handle) -> io::Result<Timeout> {
|
||||||
Ok(Timeout {
|
Ok(Timeout {
|
||||||
|
|||||||
Reference in New Issue
Block a user