Skip to main content

Module call

Module call 

Source
Expand description

What a request names: a cell URI’s <rest> (SPEC 5.3) or a call (SPEC 5.8), resolved to one canonical reference, pinned to a function hash or not (spec-0.4.2).

§The forms /cell accepts

  • A cell URI’s rest, byte for byte (SPEC 5.3): /cell/ecb.europa.eu/fx_rate?base=EUR&date=2024-03-15&quote=USD, then optionally &fn_hash=<64 hex digits> (a pin, 5.1) and &asof=<instant>. It is parsed by the core’s parse_reference against the signature of the function the pin names, or else the one the name is bound to as of that asof (or now), so every code of SPEC 5.4 is reported as it defines.

  • A call (5.8), percent-encoded as any URL path is (/cell/rates.example.org/fx_rate(%22EUR%22,%20%22USD%22,%202024-03-15)), with an optional query ?asof=<instant> and nothing else: a read of the formula dialect whose arguments are literals, the callee a full name or an @alias of the configured map, optionally pinned (name@<fn_hash>(...)). It is parsed by the formula crate’s datumesh_formula::call::parse_call in 5.8’s order and codes, written as its cell URI and resolved as above: a call and its URI are one request.

    Since 0.2.2 (spec-0.5.0, 5.8, 16.3, 16.7) the call is also a method call (N(keys).m(args), the same request as the plain read N/m(keys, args)), takes unquoted values by the position’s type, labels (N[label], through the class’s lookup), the asof default (the call’s asof, or the mesh’s now, in the cell URI) and a bare name through the alias map. What it resolved is Target::resolved, the answer’s resolved (5.5). A key not canonical under its normalisation is E_KEY_NORMALISATION, a malformed encoding E_KEY_ENCODING (both bad_request). Not accepted: expressions, ranges or units (E_PARSE_URI).

An unbound name (or alias) is not_covered with E_NAME_UNBOUND (Rejection::Error(ErrorCode::NameUnbound), which the mesh answers so); a pin no descriptor of the mesh has is a plain not_covered (Rejection::NotCovered); a slice marker at /cell is E_SLICE_AT_CELL.

Structs§

Bound
A function bound to a name as of an instant.
BoundClass
A class name’s binding as of an instant (spec-0.5.0, 9.7): the class hash and the flattened descriptor.
Target
A request resolved to its cell (or slice, at /slice).

Enums§

Rejection
Why a request names no cell.

Traits§

Bindings
Where names are looked up: the mesh’s store (and, for names under other hosts, the cross-mesh resolver in front of it).

Functions§

format_pinned
The URI of a reference with its pin (core’s format_reference).
is_call
Whether rest (the text after /cell/, query included, as received) is a call rather than a cell URI’s rest: its path (before the first ?) has a ( or a %, or starts with @, none of which a cell URI’s path (namespace and name) has.
resolve
Resolves a request: a call or a cell URI’s rest (see the module documentation). now is the asof used to look the name up when the request has none. slice allows * (and requires one).
resolve_call
Resolves a call (SPEC 5.8).
resolve_uri
Resolves a cell URI’s rest.