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:
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 | DecodeErrorSince. 1.0.0-beta
Returns
bool
Errors
DecodeError@error- `DecodeError.Malformed` for a damaged value.
Effects
none declared (pure unless the body says otherwise)
Defined in: std/ser/ser.oxl:1837