moon/fory Apache Fory · MoonBit

API · error

Refused

Refusals · defined at error.mbt:11

pub(all) suberror Refused {
  Truncated(at~ : Int32, want~ : Int32, got~ : Int32)
  TooLarge(at~ : Int32, limit~ : Int64, got~ : Int64)
  TooDeep(at~ : Int32, limit~ : Int32)
  BadType(at~ : Int32, got~ : Int32)
  WantType(at~ : Int32, want~ : Int32, got~ : Int32)
  BadHeader(at~ : Int32, got~ : Int32)
  BadRef(at~ : Int32, got~ : Int32)
  BadEncoding(at~ : Int32, got~ : Int32)
  Cyclic(at~ : Int32, got~ : Int32)
  Trailing(at~ : Int32, got~ : Int32)
  Unsupported(kind~ : String)
}

Why a message was refused.

A message that cannot be read is a refusal, never a partial answer: every name here is something the writer did that the specification does not allow, and every one of them carries the offset it happened at, because a byte stream has no line numbers to point at.

Constructors

ConstructorMeaning
Truncated(at~ : Int32, want~ : Int32, got~ : Int32)

The message ends in the middle of a value.

TooLarge(at~ : Int32, limit~ : Int64, got~ : Int64)

A counted thing is past the limit this reader was configured with.

TooDeep(at~ : Int32, limit~ : Int32)

Values nested deeper than the configured depth.

BadType(at~ : Int32, got~ : Int32)

A type ID the mapping does not define.

WantType(at~ : Int32, want~ : Int32, got~ : Int32)

A type ID where the schema demands a different one.

BadHeader(at~ : Int32, got~ : Int32)

A header byte that is not an xlang header.

BadRef(at~ : Int32, got~ : Int32)

A reference to an id this message has not written yet.

BadEncoding(at~ : Int32, got~ : Int32)

A wire value the format does not define: a reserved string encoding, a chunk size of zero, a boolean that is neither.

Cyclic(at~ : Int32, got~ : Int32)

A graph whose cycle reaches back into a value still being built, where rebuilding it would recur for ever.

Trailing(at~ : Int32, got~ : Int32)

Bytes left over once the value has been read.

Unsupported(kind~ : String)

A value with no cross-language counterpart.

Built in

derives Eq @debug.Debug

pub impl Show for Refused

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