Skip to content

Commit 04351a8

Browse files
committed
core: Format comm docs correctly
1 parent ef94199 commit 04351a8

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

src/libcore/comm.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
#[doc(
22
brief = "Communication between tasks",
3-
desc = "Communication between tasks is facilitated by ports (in the \
4-
receiving task), and channels (in the sending task). Any \
5-
number of channels may feed into a single port. \
6-
Ports and channels may only transmit values of unique \
7-
types; that is, values that are statically guaranteed to \
8-
be accessed by a single 'owner' at a time. Unique types \
9-
include scalars, vectors, strings, and records, tags, \
10-
tuples and unique boxes (~T) thereof. Most notably, \
11-
shared boxes (@T) may not be transmitted across channels. \
12-
Example: \
13-
let p = comm::port(); \
14-
task::spawn(comm::chan(p), fn (c: chan<str>) { \
15-
comm::send(c, \"Hello, World\"); \
16-
}); \
17-
io::println(comm::recv(p));"
18-
)];
3+
desc = "
4+
5+
Communication between tasks is facilitated by ports (in the receiving
6+
task), and channels (in the sending task). Any number of channels may
7+
feed into a single port. Ports and channels may only transmit values
8+
of unique types; that is, values that are statically guaranteed to be
9+
accessed by a single 'owner' at a time. Unique types include scalars,
10+
vectors, strings, and records, tags, tuples and unique boxes (`~T`)
11+
thereof. Most notably, shared boxes (`@T`) may not be transmitted
12+
across channels.
13+
14+
Example:
15+
16+
let p = comm::port();
17+
task::spawn(comm::chan(p), fn (c: chan<str>) {
18+
comm::send(c, \"Hello, World\");
19+
});
20+
io::println(comm::recv(p));
21+
22+
")];
1923

2024
import sys;
2125
import task;

0 commit comments

Comments
 (0)