method TlsStream.readText
Like read, for UTF-8 text; bytes that are not valid UTF-8 give ProtocolError.
Example:
use std.net { TlsStream }
fn line(s: &TlsStream) -> str | NetError net {
s.readText(512, timeout: 2s)
}pub(api) fn readText(max: usize, timeout: Duration? = none) -> str | NetError netС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
max | usize |
timeout | Duration? = none |
Возвращает
str
Ошибки
NetError- those of `read`; `ProtocolError` when the bytes are not valid UTF-8.
Эффекты
net
Определено в: std/net/tls.oxl:281