Skip to content

Commit 212aea7

Browse files
committed
Documented the swimos_sync crate.
1 parent 1504f19 commit 212aea7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

swimos_utilities/swimos_sync/src/circular_buffer/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub fn channel<T: Send>(capacity: NonZeroUsize) -> (Sender<T>, Receiver<T>) {
5555
(Sender(inner.clone()), Receiver(inner))
5656
}
5757

58+
/// Create a circular buffer channel with a single entry.
5859
pub fn watch_channel<T: Send>() -> (Sender<T>, Receiver<T>) {
5960
channel(unsafe { NonZeroUsize::new_unchecked(1) })
6061
}
@@ -192,6 +193,7 @@ where
192193
}
193194
}
194195

196+
/// The future type returned by the [`Receiver::recv`] method.
195197
#[derive(Debug)]
196198
pub struct Recv<'a, T>(&'a mut Receiver<T>);
197199

swimos_utilities/swimos_sync/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//! # Synchronization Channels
16+
//!
17+
//! This crate contains asynchronous channels to communicate between tasks or threads.
18+
1519
mod circular_buffer;
1620

1721
pub use circular_buffer::{channel, watch_channel, Receiver, Recv, Sender};

0 commit comments

Comments
 (0)