Crate jsonb_rs

Source

Enums§

Error
JsonPath
JsonPathRef
Number
Value

Functions§

array_length
Get the length of JSONB array.
as_bool
If the JSONB is a Boolean, returns the associated bool. Returns None otherwise.
as_f64
If the JSONB is a Number, represent it as f64 if possible. Returns None otherwise.
as_i64
If the JSONB is a Number, represent it as i64 if possible. Returns None otherwise.
as_null
If the JSONB is a Null, returns (). Returns None otherwise.
as_number
If the JSONB is a Number, returns the Number. Returns None otherwise.
as_str
If the JSONB is a String, returns the String. Returns None otherwise.
as_u64
If the JSONB is a Number, represent it as u64 if possible. Returns None otherwise.
build_array
Build JSONB array from items. Assuming that the input values is valid JSONB data.
build_object
Build JSONB object from items. Assuming that the input values is valid JSONB data.
compare
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).
from_slice
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_by_name_ignore_case
Get the inner value by ignoring case name of JSONB object.
get_by_path
Get the inner value by JSON path of JSONB object. JSON path can be a nested index or name, used to get inner value of array and object respectively.
is_array
Returns true if the JSONB is An Array. Returns false otherwise.
is_boolean
Returns true if the JSONB is a Boolean. Returns false otherwise.
is_f64
Returns true if the JSONB is a f64 Number. Returns false otherwise.
is_i64
Returns true if the JSONB is a i64 Number. Returns false otherwise.
is_null
Returns true if the JSONB is a Null.
is_number
Returns true if the JSONB is a Number. Returns false otherwise.
is_object
Returns true if the JSONB is An Object. Returns false otherwise.
is_string
Returns true if the JSONB is a String. Returns false otherwise.
is_u64
Returns true if the JSONB is a u64 Number. Returns false otherwise.
object_keys
Get the keys of a JSONB object.
parse_json_path
Parse path string to Json path. Support ["<name>"], [<index>], :name and .name.
parse_value
to_bool
Cast JSONB value to Boolean
to_f64
Cast JSONB value to f64
to_i64
Cast JSONB value to i64
to_str
Cast JSONB value to String
to_string
Convert JSONB value to String
to_u64
Cast JSONB value to u64

Type Aliases§

Object