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

fn decode

Decodes b into a T; errors per [С §9.4].

Example:

oxl✓ проверяется в CI
use std.ser { encode, decode }

fn main() io {
  let b = encode(&"hi")!
  let s: str = decode(&b)!
  print(s)
}
Вывод
hi
@intrinsic("ser.decode") pub(api) fn decode<T: Serializable>(b: &bytes, fmt: Format = Format.Oxl) -> T | DecodeError

С версии. 1.0.0-beta

Параметры

ИмяТип
b&bytes
fmtFormat = Format.Oxl

Возвращает

T

Ошибки

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/ser/ser.oxl:2306

См. также