Crate jsonb

source ·

Modules

Enums

Functions

  • Get the length of JSONB array.
  • If the JSONB is a Boolean, returns the associated bool. Returns None otherwise.
  • If the JSONB is a Number, represent it as f64 if possible. Returns None otherwise.
  • If the JSONB is a Number, represent it as i64 if possible. Returns None otherwise.
  • If the JSONB is a Null, returns (). Returns None otherwise.
  • If the JSONB is a Number, returns the Number. Returns None otherwise.
  • If the JSONB is a String, returns the String. Returns None otherwise.
  • If the JSONB is a Number, represent it as u64 if possible. Returns None otherwise.
  • Build JSONB array from items. Assuming that the input values is valid JSONB data.
  • Build JSONB object from items. Assuming that the input values is valid JSONB data.
  • JSONB values supports partial decode for comparison, if the values are found to be unequal, the result will be returned immediately. In first level header, values compare as the following order: Scalar Null > Array > Object > Other Scalars(String > Number > Boolean).
  • The binary JSONB contains three parts, Header, JEntry and RawData. This structure can be nested. Each group of structures starts with a Header. The upper-level Value will store the Header length or offset of the lower-level Value. Header stores the type of the Value, include Array, Object and Scalar, Scalar has only one Value, and a corresponding JEntry. Array and Object are nested type, they have multiple lower-level Values. So the Header also stores the number of lower-level Values. JEntry stores the types of Scalar Value, including Null, True, False, Number, String and Container. They have three different decode methods.
  • Get the inner element of JSONB Array by index.
  • Get the inner element of JSONB Object by key name.
  • Get the inner element of JSONB Object by key name ignoring case.
  • Get the inner elements of JSONB value by JSON path. The return value may contains multiple matching elements.
  • Get the inner elements of JSONB value by JSON path. If there are multiple matching elements, return an JSONB Array.
  • Get the inner element of JSONB value by JSON path. If there are multiple matching elements, only the first one is returned
  • Returns true if the JSONB is An Array. Returns false otherwise.
  • Returns true if the JSONB is a Boolean. Returns false otherwise.
  • Returns true if the JSONB is a f64 Number. Returns false otherwise.
  • Returns true if the JSONB is a i64 Number. Returns false otherwise.
  • Returns true if the JSONB is a Null.
  • Returns true if the JSONB is a Number. Returns false otherwise.
  • Returns true if the JSONB is An Object. Returns false otherwise.
  • Returns true if the JSONB is a String. Returns false otherwise.
  • Returns true if the JSONB is a u64 Number. Returns false otherwise.
  • Get the keys of a JSONB object.
  • Cast JSONB value to Boolean
  • Cast JSONB value to f64
  • Cast JSONB value to i64
  • Cast JSONB value to String
  • Convert JSONB value to String
  • Cast JSONB value to u64

Type Definitions