method Sender.send
Sends a value, waiting while the buffer is full; Closed if the receiver is gone.
Example:
fn main() io {
let (tx, rx) = chan<i64>(cap: 1)
tx.send(5)!
print("{rx.recv()!}")
}Вывод
5
pub(api) fn send(x: T) -> () | ClosedС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
x | T |
Возвращает
()
Ошибки
Closed@error- `Closed` when the receiver is gone.
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/task.oxl:84