Skip to main content

Module value_wire

Module value_wire 

Source
Expand description

CORBA valuetype wire (§15.3.4) — the self-describing, shared object encoding. A value instance is written as value_tag + RepositoryId + state members; the same instance (Rc identity) a second time as an indirection (value sharing, §15.3.4) — so object graphs with multiple references are preserved.

§value_tag (§15.3.4.1) — bit layout

Verified against JacORB CDRInputStream (the reference implementation against which cross-ORB testing is done):

  • 0x00000000 — null value.
  • 0xffffffff — indirection, followed by a long offset relative to the position of the offset field (backwards to the target value_tag).
  • 0x7fffff00 .. 0x7fffffff — a value follows; flags in the low byte:
    • Bit 0 (0x01) — codebase URL present.
    • Bit 3 (0x08) — chunked encoding.
    • Bits 1-2 (0x06) — type info: 0x00 none / 0x02 single RepositoryId / 0x06 list of RepositoryIds.

Scope of this engine: non-chunked + chunked encoding, single/list RepositoryId, value sharing (DAG), truncation, nested chunked values + multi-level end-tags, and codebase URL resolution via a CodebaseResolver.

Structs§

ChunkedNode
A node in a chunked valuetype tree (§15.3.4.3) for multi-chunk encoding via ValueWriter::write_chunked_tree: a value, its base RepositoryIds (most-derived → base, written in the value_tag list), and nested chunked values appended after its state at chunk boundaries. Lets a chunked value carry further chunked values (e.g. a truncatable derived tail) instead of a single flat state chunk.
ValueReader
Reads valuetype instances with indirection resolution (value sharing): an indirection yields the same Rc instance as the referenced value_tag.
ValueRegistry
RepositoryId → state-reader factory. Generated code registers a factory per valuetype; an optional CodebaseResolver resolves unknown RepositoryIds via the codebase URL.
ValueWriter
Writes valuetype instances with value sharing: the same Rc instance is encoded as an indirection on the second write (one object, not two copies).

Traits§

ValueMarshal
A concrete valuetype that marshals over the §15.3.4 wire. Generated code implements this in addition to ValueBase.

Type Aliases§

CodebaseResolver
Codebase resolver: returns — based on the codebase URL carried over the wire (§15.3.4.1, value_tag bit 0) and the RepositoryId — a factory for a valuetype whose factory is not statically registered. This way the codebase URL is taken into account in factory resolution (instead of just being skipped) — the Rust counterpart to the CORBA codebase download.
ValueCtor
Factory closure: reads the state members of a valuetype and returns a typed instance as Rc<dyn Any> (the caller downcasts to the concrete type).