Skip to main content

Module value

Module value 

Source
Expand description

Valuetypes on the rorb_out and rorb_in streams.

The caller marshals the state of its own instances; these functions write and read what surrounds it (the value tag, the repository ids, chunks, end tags) and keep what sharing needs: an instance written twice in a message is sent as an indirection the second time (the caller names instances by a key), and the instances read are kept by slot, so that an indirection to one gives the same instance back.

Structs§

Held
An instance of the caller kept by an input stream.

Constants§

VALUE_INDIRECTION
VALUE_NEW
VALUE_NULL
RORB_VALUE_NULL, RORB_VALUE_INDIRECTION, RORB_VALUE_NEW.

Functions§

rorb_in_end_value⚠
Ends the value whose header was read last, skipping the state not read (of a truncated derived type).
rorb_in_get_value⚠
The instance kept for slot, or NULL (an indirection to a value the caller did not read, say).
rorb_in_keeps_hosts⚠
Whether the stream gives the caller’s instances it reads to the core (rorb_in_set_host_value): 1 for the stream of rorb_any_extract.
rorb_in_read_value_header⚠
Reads what stands where a value is expected. For an indirection, *slot is the slot of the value it refers to; for a new value, its own slot and *id_count the number of repository ids sent (read with rorb_in_value_id). After an error, returns RORB_VALUE_NULL.
rorb_in_set_host_value⚠
Like rorb_in_set_value, with the caller’s key of the instance (as it writes it with rorb_out_begin_host_value): the stream of rorb_any_extract then gives ptr to the any’s core instance, which keeps it instead of the stream.
rorb_in_set_value⚠
Keeps ptr, the caller’s instance of the value at slot, until the stream ends; release(ptr) is then called (unless it is NULL).
rorb_in_value_id⚠
The repository id index of the last value header read (UTF-8, valid until the next value header).
rorb_out_begin_host_value⚠
Like rorb_out_begin_value, and takes host, a reference to the caller’s instance (released with release when not kept): an any whose value is read back from the stream keeps it, so that extracting gives the same instance, and inserting the instance (the same key) again reuses the core’s instance.
rorb_out_begin_value⚠
Starts a value: returns 1 when the caller writes its state (then calls rorb_out_end_value), 0 when an indirection was written or the stream failed.
rorb_out_end_value⚠
rorb_out_keeps_hosts⚠
Whether the stream keeps the caller’s instances written (rorb_out_begin_host_value): 1 for the stream of rorb_any_insert.
rorb_out_write_null_value⚠
rorb_register_value_type⚠
Makes the valuetype tc known to the core, which reads the values in anys (see rustorb_core::register_value_type).
rorb_set_value_type_resolver⚠
Asks resolve(context, id, len) for the valuetypes the core reads that are not registered (NULL removes it).

Type Aliases§

ReleaseFn
Releases an instance stored with rorb_in_set_value.
ResolveFn
Finds the valuetype of a repository id: a new TypeCode handle (taken over) or NULL.