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_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_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_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_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.