moon/fory Apache Fory · MoonBit

API · enum

RefFlag

Reading · defined at reader.mbt:10

pub(all) enum RefFlag {
  Null
  Ref(id~ : Int32)
  NotNull
  RefValue(id~ : Int32)
}

What the byte before a value can say about it.

The four flags are the specification's, and they are how a nullable field, a shared value and a value that is simply there are told apart: one byte, before the value, that says which.

Variants

VariantMeaning
Null

0xFD: there is no value. What a nullable field holds when it holds nothing.

Ref(id~ : Int32)

0xFE: the value is one that has already gone past, and the id says which one. A reference, and the reason this is not a tagged encoder.

NotNull

0xFF: there is a value here, and it is not tracked.

RefValue(id~ : Int32)

0x00: there is a value here, and it may be pointed at; the id is the one it is given.

Built in

derives Eq @debug.Debug

Generated from src/pkg.generated.mbti and the doc comments beside this declaration.