pub struct Lua;Expand description
The Lua backend.
Trait Implementations§
Source§impl CodecTarget for Lua
impl CodecTarget for Lua
Source§fn scalar(kind: Scalar) -> Self::Type
fn scalar(kind: Scalar) -> Self::Type
The tag and nothing else: Lua declares no types. boolean is
the one tag Self::cast acts on.
Source§fn code_point(value: Self::Expr, _narrow: bool) -> Self::Expr
fn code_point(value: Self::Expr, _narrow: bool) -> Self::Expr
The member holds the code point already, so there is nothing to convert in either direction.
Source§fn constant(which: Constant) -> Self::Expr
fn constant(which: Constant) -> Self::Expr
The runtime’s policy values, in the spelling runtime/lua
matches — the same strings runtime/python takes, because both
spell WstringLengthPolicy::as_str and its siblings. One arm
per constant and no catch-all, so a policy this column has not
implemented is a compile error here rather than a plausible
value.
Source§fn unsigned_holder(_bits: u16) -> Self::Type
fn unsigned_holder(_bits: u16) -> Self::Type
A Lua integer, at every bit bound: 64 bits hold every
@bit_bound a set can declare.
Source§fn unsigned_less(octets: u8, left: Self::Expr, right: Self::Expr) -> Self::Expr
fn unsigned_less(octets: u8, left: Self::Expr, right: Self::Expr) -> Self::Expr
Whether left is less than right as unsigned integers.
At eight octets the held value is the two’s-complement bit
pattern and Lua’s < is signed, so the answer is math.ult —
Lua’s own unsigned comparison. Narrower widths hold the value
itself, non-negative, and the default < is right.
Source§fn bool_less(left: Self::Expr, right: Self::Expr) -> Self::Expr
fn bool_less(left: Self::Expr, right: Self::Expr) -> Self::Expr
false before true. Lua’s < refuses two booleans outright —
“attempt to compare two boolean values” — so the order is
spelled as not (left) and (right), which is false-before-true
exactly.
Source§fn map_entry_name(_ast: &Ast, _id: Id<TypeNode>) -> String
fn map_entry_name(_ast: &Ast, _id: Id<TypeNode>) -> String
A map entry is a plain { key = …, value = … } table; the name
is a marker Self::storage matches on and nothing declares.
Source§fn module_prefix(_ast: &Ast, _id: Id<TypeNode>) -> String
fn module_prefix(_ast: &Ast, _id: Id<TypeNode>) -> String
Nothing: the declared paths this backend writes go through
Self::enumerator_constant and the defaulters, both rooted at
M, and a prefix would be a second answer to the same question.
Source§fn escape(name: &str) -> String
fn escape(name: &str) -> String
The identifier, unchanged. Lua renames nothing: a keyword member
keeps its name and only the syntax it is reached by changes —
t["end"] instead of t.end — which lua::Place::field and
lua::table_key decide at the use.
Source§fn wide_int(value: i128) -> Self::Expr
fn wide_int(value: i128) -> Self::Expr
An integer literal that survives its own width. A Lua decimal
numeral above 2^63 − 1 denotes a float (reference §3.1) and a
hexadecimal one wraps to the exact bit pattern, so a union label
like 16045690984833335998 is written 0xDEADBEEFCAFEBABE-style
— the same reading the member itself holds. The same care covers
−2^63 itself: -9223372036854775808 is unary minus over a
numeral that is already a float by the time the minus applies,
so the minimum goes out as its own hex pattern too.
Source§fn wide_unsigned(value: u64) -> Self::Expr
fn wide_unsigned(value: u64) -> Self::Expr
As Self::wide_int, from the unsigned side.
Source§fn unsigned_int(value: i128) -> Self::Expr
fn unsigned_int(value: i128) -> Self::Expr
The number, with no suffix: 2u is not a Lua numeral.
Source§fn literal(value: Literal) -> Self::Expr
fn literal(value: Literal) -> Self::Expr
A literal, with the two raw tokens the walk escapes through
Literal::Int read back as the booleans they are. Lua spells
them the same way C does, so this is for the tree’s sake rather
than the renderer’s: a Literal::Bool cannot be mistaken for a
number by anything that walks the statements later.
Source§fn call(callee: &str, args: Vec<Self::Expr>) -> Self::Expr
fn call(callee: &str, args: Vec<Self::Expr>) -> Self::Expr
A call to a generated codec — or, for the one C name the walk
hands here, to the runtime’s byte-wise strcmp: Lua’s own <
on strings goes through strcoll and the process’s locale, and
a map’s entry order must not.
Source§fn runtime(receiver: &str, method: &str, args: Vec<Self::Expr>) -> Self::Expr
fn runtime(receiver: &str, method: &str, args: Vec<Self::Expr>) -> Self::Expr
zdw.write_u32(w, x) — the runtime is a table of functions
taking the writer or reader first, so the receiver becomes the
first argument.
Source§fn runtime_static(method: &str, args: Vec<Self::Expr>) -> Self::Expr
fn runtime_static(method: &str, args: Vec<Self::Expr>) -> Self::Expr
A free function of the runtime — the same table, because the
runtime is one table: zdw.no_dheader(),
zdw.pid_is_user_member(zd_p), zdw.utf8_octets(v).
Source§fn carries_hdds_axes() -> bool
fn carries_hdds_axes() -> bool
runtime/lua carries the three HDDS axes: begin_packed_element /
finish_packed_element on the writer and
reader_begin_packed_element / reader_finish_packed_element on the
reader, the DHEADER pair for a sequence element’s own length, and
write_wstring_utf8_octets / read_wstring_utf8_octets.
Source§fn member(base: &str, field: &str) -> Self::Expr
fn member(base: &str, field: &str) -> Self::Expr
A field name with dots is a path through the members that hold a base
(parent.x, XTypes 1.3 §7.5.1.4.1.3): one field step per segment.
Source§fn inherited_path(depth: usize) -> Option<String>
fn inherited_path(depth: usize) -> Option<String>
The base is the first member parent (XTypes 1.3 §7.5.1.4.1.3).
Source§fn index(value: Self::Expr, at: Self::Expr) -> Self::Expr
fn index(value: Self::Expr, at: Self::Expr) -> Self::Expr
t[(i) + 1] — the one place the 0-based walk meets Lua’s
1-based tables. Every counter stays 0-based (see
Self::count_up), so every subscript adds one, here and
nowhere else.
Source§fn count_of(base: &str, fixed: Option<u64>) -> Self::Expr
fn count_of(base: &str, fixed: Option<u64>) -> Self::Expr
#v, or the bound where the materialiser fixed one. The length
operator counts the array part’s border, which for the
contiguous tables this column builds is the element count.
Source§fn cast(type_: Self::Type, value: Self::Expr) -> Self::Expr
fn cast(type_: Self::Type, value: Self::Expr) -> Self::Expr
The identity on every integer — Lua’s integer holds every IDL
width’s pattern and runtime/lua range-checks at the octet —
and a rewrite on two things that are not integers:
- a boolean discriminator holds
true/false, andv._d == 1is never true against a boolean, so an integer label becomes the literal; signed char, C’s reading of amap’scharkey, which this column computes as((cp + 128) % 256) - 128— Lua’s%is floored, so the two’s-complement wrap is exact.
A char label needs nothing: the member holds the code point as
an integer already.
Source§fn handoff(value: Self::Expr, _form: Handoff) -> Self::Expr
fn handoff(value: Self::Expr, _form: Handoff) -> Self::Expr
The value, unchanged: Lua passes every table by reference and takes no address.
Source§fn declare(
_type_: Self::Type,
name: &str,
value: Option<Self::Expr>,
) -> Self::Stmt
fn declare( _type_: Self::Type, name: &str, value: Option<Self::Expr>, ) -> Self::Stmt
local name = value, or local name. The type is a tag Lua has
no syntax for and is dropped.
Source§fn perform(value: Self::Expr) -> Self::Stmt
fn perform(value: Self::Expr) -> Self::Stmt
An assignment where the walk built one, the call statement everywhere else — the only expression Lua’s grammar takes as a statement, and the only other thing the walk performs.
Source§fn give_back(value: Option<Self::Expr>) -> Self::Stmt
fn give_back(value: Option<Self::Expr>) -> Self::Stmt
return v: this column’s decoders answer with the sample —
there is no out-parameter to fill — so the walk’s bare
give_back(None) returns the local the body built.
Source§fn count_up(counter: &str, bound: Self::Expr, body: Self::Block) -> Self::Stmt
fn count_up(counter: &str, bound: Self::Expr, body: Self::Block) -> Self::Stmt
for counter = 0, bound - 1 do … end. The counter stays
0-based — Self::index carries the whole 1-based convention —
and Lua’s inclusive upper bound takes the minus one.
Source§fn drop_value(value: Self::Expr) -> Self::Stmt
fn drop_value(value: Self::Expr) -> Self::Stmt
The call, alone: Lua warns about nothing and (nil) call is not
a statement.
Source§fn mark_used(_name: &str) -> Vec<Self::Stmt>
fn mark_used(_name: &str) -> Vec<Self::Stmt>
Nothing: an unread parameter is not a diagnostic Lua has, and a bare name is not a statement.
Source§fn read_call(
callee: &str,
place: Self::Expr,
_form: Handoff,
behaviour: Self::Expr,
) -> Self::Stmt
fn read_call( callee: &str, place: Self::Expr, _form: Handoff, behaviour: Self::Expr, ) -> Self::Stmt
place = ZD.zd_dec_T(r, zd_tc): decoders answer with the value
and the destination is the assignment’s left-hand side.
Source§fn read_forward(callee: &str) -> Self::Stmt
fn read_forward(callee: &str) -> Self::Stmt
v = ZD.zd_dec_T(r, zd_tc) — a typedef, handed straight on.
Source§fn make_room(
base: &str,
_element: Self::Type,
count: Self::Expr,
assigned_whole: bool,
fill: Vec<Self::Stmt>,
) -> Vec<Self::Stmt>
fn make_room( base: &str, _element: Self::Type, count: Self::Expr, assigned_whole: bool, fill: Vec<Self::Stmt>, ) -> Vec<Self::Stmt>
Room for count values: a fresh table, and — for a map, whose
entries are written half at a time — one {} per slot ahead of
the fill, because v[i].key = … needs the slot table to exist.
A sequence’s element decoder assigns the slot outright and needs
only the outer table; Lua tables grow as they are written.
Source§fn keep_first(base: &str, count: Self::Expr) -> Vec<Self::Stmt>
fn keep_first(base: &str, count: Self::Expr) -> Vec<Self::Stmt>
Drop everything past count: shorten from the border, one
element at a time — t[#t] = nil moves the border down — until
the bound holds. §7.3.1.2.1.12.3’s TRIM.
Source§fn sequence_element(
base: &str,
index: Self::Expr,
_element: Self::Type,
) -> (Vec<Self::Stmt>, Self::Expr, Vec<Self::Stmt>)
fn sequence_element( base: &str, index: Self::Expr, _element: Self::Type, ) -> (Vec<Self::Stmt>, Self::Expr, Vec<Self::Stmt>)
The subscript, with nothing before or after it: a Lua table element is an ordinary place at every element type.
Source§fn present(base: &str, field: &str) -> Self::Expr
fn present(base: &str, field: &str) -> Self::Expr
v.field ~= nil — in Lua the absence of a value is the absence
of the key, so presence is the key being there.
Source§fn set_present(base: &str, field: &str, present: bool) -> Vec<Self::Stmt>
fn set_present(base: &str, field: &str, present: bool) -> Vec<Self::Stmt>
Nothing on the way in — writing the member is what makes it
present — and v.field = nil on the way out, which removes the
key.
Source§fn clear_union_cases(base: &str, fields: &[String]) -> Vec<Self::Stmt>
fn clear_union_cases(base: &str, fields: &[String]) -> Vec<Self::Stmt>
v.field = nil for every case: a union’s branches are keys beside
_d on one table, and a branch the discriminator does not select
is a key that is not there. The same statement as an absent
@optional member, Self::set_present with false.
Source§fn optional_destination(
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn optional_destination( base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
The member, with nothing to do first: there is no wrapper to engage before a table key can be written.
Source§fn optional_value(
_ast: &Ast,
_id: Id<TypeNode>,
base: &str,
field: &str,
) -> Self::Expr
fn optional_value( _ast: &Ast, _id: Id<TypeNode>, base: &str, field: &str, ) -> Self::Expr
The member itself: the key holds the value or is absent.
Source§fn case_member(base: &str, field: &str) -> Self::Expr
fn case_member(base: &str, field: &str) -> Self::Expr
v.field — a union’s branches sit beside _d on one table.
Source§fn entry_half(entry: Self::Expr, key: bool) -> Self::Expr
fn entry_half(entry: Self::Expr, key: bool) -> Self::Expr
entry.key and entry.value — a map entry is a table with the
two keys adapter/lua.rs names.
Source§fn materialised(_value: Self::Expr) -> Option<Self::Expr>
fn materialised(_value: Self::Expr) -> Option<Self::Expr>
Nothing: a Lua string owns its storage and a read that ran out of memory raised long before this question.
Source§fn storage(type_: Self::Type, name: &str) -> Self::Stmt
fn storage(type_: Self::Type, name: &str) -> Self::Stmt
A local the body writes into: for the one type this is asked
for — the map entry marker — a fresh table, so zd_scratch.key
has somewhere to land.
Source§fn routine(spec: Routine<Self>) -> Option<Self::Decl>
fn routine(spec: Routine<Self>) -> Option<Self::Decl>
function ZD.zd_enc_T(w, v) … end, or the reading form that
opens from Table 9 and returns the sample. A forward declaration
is answered with nothing: ZD.<name> resolves at the call, so a
recursive or mutually recursive type needs none.
Source§fn default_into(
ast: &Ast,
id: Id<TypeNode>,
place: Self::Expr,
) -> Result<Self::Stmt, EncodeError>
fn default_into( ast: &Ast, id: Id<TypeNode>, place: Self::Expr, ) -> Result<Self::Stmt, EncodeError>
§Errors
Never; the signature matches the emitters around it.
Source§fn member_default(
ast: &Ast,
node: &MemberNode,
type_: Id<TypeNode>,
place: Self::Expr,
) -> Result<Vec<Self::Stmt>, EncodeError>
fn member_default( ast: &Ast, node: &MemberNode, type_: Id<TypeNode>, place: Self::Expr, ) -> Result<Vec<Self::Stmt>, EncodeError>
§Errors
As crate::default_lua::member_default: a @default this
column cannot spell as a Lua expression is refused rather than
silently replaced by Table 9’s zero.
Source§fn enumerator_constant(
ast: &Ast,
id: Id<TypeNode>,
enumerator: &str,
) -> Self::Expr
fn enumerator_constant( ast: &Ast, id: Id<TypeNode>, enumerator: &str, ) -> Self::Expr
M.a.b.Colour.values.RED — the declared value out of the
descriptor the materialiser wrote, through its own path
derivation, so the codec cannot part from it over a spelling.
An enumeration member is an integer here, so the constant
compares directly against what the member holds.
Source§fn value_type(ast: &Ast, id: Id<TypeNode>) -> Self::Type
fn value_type(ast: &Ast, id: Id<TypeNode>) -> Self::Type
id where a codec holds it. Read moreSource§fn type_name(ast: &Ast, id: Id<TypeNode>) -> String
fn type_name(ast: &Ast, id: Id<TypeNode>) -> String
id. Read moreSource§fn wide_signed(value: i128) -> Self::Expr
fn wide_signed(value: i128) -> Self::Expr
CodecTarget::wide_unsigned.Source§fn whole(base: &str) -> Self::Expr
fn whole(base: &str) -> Self::Expr
Source§fn elements(base: &str) -> Self::Expr
fn elements(base: &str) -> Self::Expr
Source§fn binary(op: &'static str, lhs: Self::Expr, rhs: Self::Expr) -> Self::Expr
fn binary(op: &'static str, lhs: Self::Expr, rhs: Self::Expr) -> Self::Expr
a op b, written as given.Source§fn when(
condition: Self::Expr,
then: Self::Block,
otherwise: Option<Self::Block>,
) -> Self::Stmt
fn when( condition: Self::Expr, then: Self::Block, otherwise: Option<Self::Block>, ) -> Self::Stmt
if (cond) { .. } else { .. }Source§fn until(condition: Self::Expr, body: Self::Block) -> Self::Stmt
fn until(condition: Self::Expr, body: Self::Block) -> Self::Stmt
Source§fn bit_pattern(source: BitPatternSource, value: Self::Expr) -> Self::Expr
fn bit_pattern(source: BitPatternSource, value: Self::Expr) -> Self::Expr
BitPatternSource; consumed by
the runtime’s write_union_overlay, which writes the low
octets of the pattern as one integer of that width in wire
endianness — the Cyclone union overlay. Read moreSource§fn bulk_octets_write(base: &str, count: Self::Expr) -> Option<Self::Stmt>
fn bulk_octets_write(base: &str, count: Self::Expr) -> Option<Self::Stmt>
count octet elements of base at once, in place of the
element loop of a sequence<octet> or a one-dimensional
octet[N] (and the same over uint8); None, the default, keeps
the loop. The octets are the loop’s: an octet has alignment 1 and
no byte order (XTypes 1.3 §7.4.3.4.1), so a run of them is the same
bytes however it is copied. What a target gains is the per-element
call — measured in the C++ column: sequence<octet, 8192> element
by element cost ~100 µs per roundtrip of four codec passes.Source§fn bulk_octets_read(base: &str, count: Self::Expr) -> Option<Self::Stmt>
fn bulk_octets_read(base: &str, count: Self::Expr) -> Option<Self::Stmt>
Self::bulk_octets_write: count octets into
base, which already holds room for them.Source§fn make_room_of(
_ast: &Ast,
_element_id: Id<TypeNode>,
base: &str,
element: Self::Type,
count: Self::Expr,
assigned_whole: bool,
fill: Vec<Self::Stmt>,
) -> Vec<Self::Stmt>
fn make_room_of( _ast: &Ast, _element_id: Id<TypeNode>, base: &str, element: Self::Type, count: Self::Expr, assigned_whole: bool, fill: Vec<Self::Stmt>, ) -> Vec<Self::Stmt>
CodecTarget::make_room for a sequence whose element is
element_id. A target that cannot spell a slot’s start value from
element alone overrides it: Kotlin’s Array(n) { T() } has no
constructor to call where T is a typealias of Int.Source§fn store(place: Self::Expr, type_: Self::Type, value: Self::Expr) -> Self::Stmt
fn store(place: Self::Expr, type_: Self::Type, value: Self::Expr) -> Self::Stmt
type_. Read moreSource§fn header_field(value: Self::Expr, field: &str) -> Self::Expr
fn header_field(value: Self::Expr, field: &str) -> Self::Expr
Source§fn open_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
fn open_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
lengths are its dimensions,
outermost first. Read moreSource§fn close_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
fn close_array(base: &str, lengths: &[i128]) -> Vec<Self::Stmt>
CodecTarget::open_array.Source§fn enumerator_ordinal(
ast: &Ast,
id: Id<TypeNode>,
value: Self::Expr,
) -> Self::Expr
fn enumerator_ordinal( ast: &Ast, id: Id<TypeNode>, value: Self::Expr, ) -> Self::Expr
Source§fn case_label(ast: &Ast, discriminator: Id<TypeNode>, value: i128) -> Self::Expr
fn case_label(ast: &Ast, discriminator: Id<TypeNode>, value: i128) -> Self::Expr
Source§fn behind_indirection(
ast: &Ast,
id: Id<TypeNode>,
place: Self::Expr,
) -> Self::Expr
fn behind_indirection( ast: &Ast, id: Id<TypeNode>, place: Self::Expr, ) -> Self::Expr
Source§fn make_indirection(
ast: &Ast,
id: Id<TypeNode>,
place: Self::Expr,
) -> (Vec<Self::Stmt>, Self::Expr)
fn make_indirection( ast: &Ast, id: Id<TypeNode>, place: Self::Expr, ) -> (Vec<Self::Stmt>, Self::Expr)
CodecTarget::behind_indirection:
the same place, and what has to happen before a reader can write
through it. Read moreSource§fn holds_by_reference(
ast: &Ast,
aggregate: Id<TypeNode>,
member_type: Id<TypeNode>,
optional: bool,
external: bool,
) -> bool
fn holds_by_reference( ast: &Ast, aggregate: Id<TypeNode>, member_type: Id<TypeNode>, optional: bool, external: bool, ) -> bool
@optional or @external member of
aggregate, of type member_type, behind a reference of its own
— where the shared walk would reach it through
CodecTarget::present, CodecTarget::optional_value and
their external_ counterparts. A member this answers for goes
through CodecTarget::reference_present,
CodecTarget::reference_value,
CodecTarget::reference_destination and
CodecTarget::reference_absent instead. Read moreSource§fn reference_present(base: &str, field: &str) -> Self::Expr
fn reference_present(base: &str, field: &str) -> Self::Expr
CodecTarget::holds_by_reference answers for
is present. Reached only where that answered true.Source§fn reference_value(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
) -> Self::Expr
fn reference_value( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, ) -> Self::Expr
Source§fn reference_destination(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn reference_destination( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
id is the member’s type.Source§fn reference_absent(base: &str, field: &str) -> Vec<Self::Stmt>
fn reference_absent(base: &str, field: &str) -> Vec<Self::Stmt>
Source§fn holds_a_cycle_externally() -> bool
fn holds_a_cycle_externally() -> bool
@external one — through the external_ seams
below, whether or not the member carries the annotation. Read moreSource§fn externals_are_pointers() -> bool
fn externals_are_pointers() -> bool
@external member behind a pointer
of its own, where the member’s value is not a pointer already. Read moreSource§fn optionals_are_pointers() -> bool
fn optionals_are_pointers() -> bool
@optional member behind a pointer
of its own, where the member’s value is not a pointer already. Read moreSource§fn value_is_pointer(ast: &Ast, id: Id<TypeNode>) -> bool
fn value_is_pointer(ast: &Ast, id: Id<TypeNode>) -> bool
id is a pointer already, so that
an @external or @optional member of that type needs no pointer
of its own. C’s string, wstring and fixed are
const char * (XTypes 1.3 §7.5.1.2.3.1); a C++ std::string is
a value.Source§fn refuse_unset_external(present: Self::Expr) -> Vec<Self::Stmt>
fn refuse_unset_external(present: Self::Expr) -> Vec<Self::Stmt>
@external
member that is not @optional has no value at the time of the
write. Read moreSource§fn external_value(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
optional: bool,
) -> Self::Expr
fn external_value( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, optional: bool, ) -> Self::Expr
@external member, as the member’s codec takes
it. Read moreSource§fn external_destination(
base: &str,
field: &str,
optional: bool,
) -> (Vec<Self::Stmt>, Self::Expr)
fn external_destination( base: &str, field: &str, optional: bool, ) -> (Vec<Self::Stmt>, Self::Expr)
@external member’s value, and what it
takes to have somewhere to put it. The reading counterpart of
CodecTarget::external_value, shaped like
CodecTarget::optional_destination and for the same reason: a
column whose member is an indirection has to make storage before
there is a value to write into. The default is the walk’s old
answer for both combinations.Source§fn external_present(base: &str, field: &str) -> Self::Expr
fn external_present(base: &str, field: &str) -> Self::Expr
@optional @external member is present. Read moreSource§fn external_set_present(
base: &str,
field: &str,
present: bool,
) -> Vec<Self::Stmt>
fn external_set_present( base: &str, field: &str, present: bool, ) -> Vec<Self::Stmt>
@optional @external member is present, or is not.
The counterpart of CodecTarget::set_present, split for the
reason CodecTarget::external_present gives.Source§fn external_case_value(
ast: &Ast,
id: Id<TypeNode>,
base: &str,
field: &str,
) -> Self::Expr
fn external_case_value( ast: &Ast, id: Id<TypeNode>, base: &str, field: &str, ) -> Self::Expr
@external union branch, as the branch’s codec
takes it. The union counterpart of
CodecTarget::external_value, reached through
CodecTarget::case_member because that is the accessor a
branch has; there is no optional parameter because no union
member is @optional (DDS-XTypes 1.3 §7.2.2.4.4.4.7). The
default is the accessor itself — the columns that keep the value
inline — and a column that keeps an indirection answers with the
dereference, exactly as it does for a structure member.Source§fn external_case_destination(
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn external_case_destination( base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
@external union branch’s value, and
what it takes to have somewhere to put it. The union counterpart
of CodecTarget::external_destination, shaped the same way
and defaulted the same way.