OxL Reference

method TlsStream.readText

Like read, for UTF-8 text; bytes that are not valid UTF-8 give ProtocolError.

Example:

oxl✓ checked in CI
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

Since. 1.0.0-beta

Parameters

NameType
maxusize
timeoutDuration? = 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

See also