File tree Expand file tree Collapse file tree 5 files changed +22
-8
lines changed
Expand file tree Collapse file tree 5 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,6 @@ pub(crate) fn emain(handle_sender: mpsc::SyncSender<Handle>) -> io::Result<()> {
3232 assert_eq ! ( buf. trim( ) , "Hello from side B!" ) ;
3333 //{
3434 Ok ( ( ) )
35- } //}
35+ }
3636#[ allow( dead_code) ]
37- fn main ( ) { }
37+ fn main ( ) { } //}
Original file line number Diff line number Diff line change @@ -19,6 +19,6 @@ pub(crate) fn emain(handle: Handle) -> io::Result<()> {
1919 tx. write_all ( b"Hello from side B!\n " ) ?;
2020 //{
2121 Ok ( ( ) )
22- } //}
22+ }
2323#[ allow( dead_code) ]
24- fn main ( ) { }
24+ fn main ( ) { } //}
Original file line number Diff line number Diff line change @@ -33,6 +33,6 @@ pub(crate) async fn emain(handle_sender: oneshot::Sender<Handle>) -> io::Result<
3333 assert_eq ! ( buf. trim( ) , "Hello from side B!" ) ;
3434 //{
3535 Ok ( ( ) )
36- } //}
36+ }
3737#[ allow( dead_code) ]
38- fn main ( ) { }
38+ fn main ( ) { } //}
Original file line number Diff line number Diff line change @@ -20,6 +20,6 @@ pub(crate) async fn emain(handle: Handle) -> io::Result<()> {
2020 tx. write_all ( b"Hello from side B!\n " ) . await ?;
2121 //{
2222 Ok ( ( ) )
23- } //}
23+ }
2424#[ allow( dead_code) ]
25- fn main ( ) { }
25+ fn main ( ) { } //}
Original file line number Diff line number Diff line change 11//! Tokio-based asynchronous unnamed pipes.
22//!
33//! See the [parent-level documentation](super) for more.
4+ //!
5+ //! # Examples
6+ //! See [`pipe()`].
47
58impmod ! { unnamed_pipe:: tokio,
69 Recver as RecverImpl ,
@@ -14,6 +17,17 @@ use std::io;
1417///
1518/// The platform-specific builders in the `os` module of the crate might be more helpful if extra
1619/// configuration for the pipe is needed.
20+ ///
21+ /// # Examples
22+ /// ## Basic communication
23+ /// In a parent process, within a Tokio runtime:
24+ /// ```no_run
25+ #[ doc = doctest_file:: include_doctest!( "examples/unnamed_pipe/sync/side_a.rs" ) ]
26+ /// ```
27+ /// In a child process, within a Tokio runtime:
28+ /// ```no_run
29+ #[ doc = doctest_file:: include_doctest!( "examples/unnamed_pipe/sync/side_b.rs" ) ]
30+ /// ```
1731#[ inline]
1832pub fn pipe ( ) -> io:: Result < ( Sender , Recver ) > {
1933 pipe_impl ( )
You can’t perform that action at this time.
0 commit comments