OxL Справочник OxL
РусскийEnglish

method TlsStream.readText

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

Example:

oxl✓ проверяется в 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

С версии. 1.0.0-beta

Параметры

ИмяТип
maxusize
timeoutDuration? = none

Возвращает

str

Ошибки

  • NetError
  • those of `read`; `ProtocolError` when the bytes are not valid UTF-8.

Эффекты

net

Определено в: std/net/tls.oxl:281

См. также