Skip to content

Commit 4b445d9

Browse files
committed
Adding in documentation stubs
1 parent 3999890 commit 4b445d9

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ pub use webcore::number::Number;
166166
pub use webcore::object::Object;
167167
pub use webcore::array::Array;
168168
pub use webcore::symbol::Symbol;
169+
pub use webcore::cancel::{Cancel, AutoCancel};
169170

170171
pub use webcore::unsafe_typed_array::UnsafeTypedArray;
171172
pub use webcore::once::Once;

src/webcore/cancel.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
use std::ops::{Deref, DerefMut};
22

33

4+
///
45
pub trait Cancel {
6+
///
57
fn cancel( &mut self );
68
}
79

810

11+
///
912
#[must_use = "
1013
1114
The AutoCancel is unused, which causes it to be immediately cancelled.
@@ -21,11 +24,13 @@ pub trait Cancel {
2124
pub struct AutoCancel< A: Cancel >( Option< A > );
2225

2326
impl< A: Cancel > AutoCancel< A > {
27+
///
2428
#[inline]
2529
pub fn new( canceler: A ) -> Self {
2630
AutoCancel( Some( canceler ) )
2731
}
2832

33+
///
2934
#[inline]
3035
pub fn leak( mut self ) -> A {
3136
self.0.take().unwrap()

src/webcore/promise.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Promise {
105105
/// no longer interested in the `Promise`'s result.
106106
///
107107
/// But if you *are* interested in the `Promise`'s result, then you either need to make sure to keep the handle
108-
/// alive until after the callback is called, or you need to use the `leak` method.
108+
/// alive until after the callback is called, or you need to use the [`leak`](struct.AutoCancel.html#method.leak) method.
109109
///
110110
/// Cancelling the [`DoneHandle`](struct.DoneHandle.html) does ***not*** cancel the `Promise`, because promises
111111
/// do not support cancellation.

0 commit comments

Comments
 (0)