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

method Decoder.readNull

The reader of writeNull(): true (and the value is consumed) when the next value is the null of an absent optional, false (nothing consumed) when a value follows. The default says "never null".

Example:

oxl✓ проверяется в CI
use std.ser { Codec, Encoder, Decoder, Schema, encode, decode, hex, EncodeError, DecodeError }

fn readMaybe(r: &var Decoder) -> i64? | DecodeError {
  if r.readNull()? { return none }
  r.readI64()?
}
var fn readNull() -> bool | DecodeError

С версии. 1.0.0-beta

Возвращает

bool

Ошибки

  • DecodeError @error
  • `DecodeError.Malformed` for a damaged value.

Эффекты

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

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

См. также