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

type DecodeError

Why bytes could not be decoded into a value ([С §9.4]; declared in the prelude).

Example:

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

fn main() io {
  let junk = b"\xff\xff\xff"
  match decode<i64>(&junk) {
    i64 _ => print("decoded")
    DecodeError _ => print("malformed")
  }
}
Вывод
malformed
pub(api) type DecodeError = std.core.DecodeError

С версии. 1.0.0-beta

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

См. также