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 netSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
max | usize |
timeout | Duration? = none |
Returns
str
Errors
NetError- those of `read`; `ProtocolError` when the bytes are not valid UTF-8.
Effects
net
Defined in: std/net/tls.oxl:281