~/bend-docscommunity

src/Value.bend relies on unsafe/foreign

raw source on the hub · import ber-core-store@0.1.1.0/src/Value.bend as Value

5 imports
import Base
import bend-kit-json@0.3.0.0/json.bend as Json
import ./JsonAdapter.bend as JsonAdapter
import bend-codec-lib@0.2.0.0/bytes.bend as ByteLib
import bend-codec-lib@0.2.0.0/hex.bend as HexLib

Types

type Value source · line 14 · raw

Data

One stored record value: text, structured document, or binary blob.

Definitions

def value_to_json source · line 21 · raw

@value:Value -> 0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val

Canonical JSON of a value; the hashed bytes. Distinct keys per constructor keep different values from sharing an address.

def value_to_canonical source · line 31 · raw

@value:Value -> String

Canonical text of a value.

def text_string_or_nothing source · line 35 · raw

@text_maybe:Maybe<&2, 0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val> -> Maybe<&2, String>

Reads the "t" field as text.

def bytes_data source · line 43 · raw

@byte_box:0x888714bde93f46c139372bb9fdc57a19/bytes.Bytes -> List<&2, U32>

Unwraps the decoded byte box.

def blob_or_nothing source · line 49 · raw

@decode_result:Result<&2, &2, 0x888714bde93f46c139372bb9fdc57a19/hex.Hex.Error, 0x888714bde93f46c139372bb9fdc57a19/bytes.Bytes> -> Maybe<&2, Value>

Reads a hex decode result as a blob; malformed hex reads as None.

def blob_from_hex source · line 57 · raw

@hex_maybe:Maybe<&2, String> -> Maybe<&2, Value>

Reads the "b" field as a blob.

def hex_text_or_nothing source · line 65 · raw

@hex_maybe:Maybe<&2, 0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val> -> Maybe<&2, String>

Reads the hex text behind the "b" field.

def from_object_value source · line 73 · raw

@object_maybe:Maybe<&2, 0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val> -> @hex_maybe:Maybe<&2, 0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val> -> Maybe<&2, Value>

Falls through from text to object to blob; unknown shapes read as None.

def from_text_string source · line 81 · raw

@text_maybe:Maybe<&2, String> -> @+document:0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val -> Maybe<&2, Value>

Falls through from text to the remaining shapes.

def value_from_json source · line 89 · raw

@+document:0xaaa10a97bf5ac6990143da2c863f8a3f/json.Val -> Maybe<&2, Value>

Parses canonical value JSON; unknown shapes read as None.