pub struct Node;Expand description
The Node backend.
Trait Implementations§
Source§impl CodecTarget for Node
impl CodecTarget for Node
Source§fn scalar(kind: Scalar) -> Self::Type
fn scalar(kind: Scalar) -> Self::Type
number to i32, bigint beyond it, a one-character string
for a char — the boundary crate::emit::typescript::TypeScript::scalar
draws, kept because it is the language’s own and not TypeScript’s.
Source§fn named(name: &str) -> Self::Type
fn named(name: &str) -> Self::Type
The tag, preserved exactly: this is how Node::cast recognises
"signed char", and how a call site that names a type by its own
spelling is answered honestly rather than folded into a generic
tag that would hide the collision.
Source§fn handle(_kind: Handle) -> Self::Type
fn handle(_kind: Handle) -> Self::Type
Every runtime handle is a plain object; nothing casts one.
Source§fn code_point(value: Self::Expr, _narrow: bool) -> Self::Expr
fn code_point(value: Self::Expr, _narrow: bool) -> Self::Expr
The member already is the code unit — a one-character string
for both a char and a wchar — so there is nothing to convert.
Source§fn constant(which: Constant) -> Self::Expr
fn constant(which: Constant) -> Self::Expr
The runtime’s policy tables, in runtime/node/zdwire.js’s own
spelling — the same strings runtime/typescript’s enums answer
with, since both runtimes were written against one clause and
carry the measurements in crates/ast-layout/src/key.rs under
one name apiece.
Source§fn unsigned_holder(bits: u16) -> Self::Type
fn unsigned_holder(bits: u16) -> Self::Type
number to 32 bits, bigint at 64 — the same boundary
Node::scalar draws for every other integer.
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
Node::enumerator_constant, which flattens the whole scoped
name into the one binding it names, so a prefix here would state
the same thing twice.
Source§fn escape(name: &str) -> String
fn escape(name: &str) -> String
The identity, always — zerodds_lang_cst::node::escape_member’s
documentation carries why.
Source§fn literal(value: Literal) -> Self::Expr
fn literal(value: Literal) -> Self::Expr
The raw tokens the walk escapes through Literal::Int,
rewritten into the tree’s own boolean where they are one.
Source§fn wide_int(value: i128) -> Self::Expr
fn wide_int(value: i128) -> Self::Expr
A bigint literal: the number with a trailing n. Every value
the walk hands here is one a number cannot carry exactly, so
the suffix is unconditional.
Source§fn unsigned_int(value: i128) -> Self::Expr
fn unsigned_int(value: i128) -> Self::Expr
The number, with no suffix: JavaScript has one numeric literal
grammar and no unsigned spelling — 2u is not a token.
Source§fn wide_unsigned(value: u64) -> Self::Expr
fn wide_unsigned(value: u64) -> Self::Expr
123n, Node::wide_int’s spelling: the trait’s default is C’s
UINT64_C(123), a macro no JavaScript file declares.
Source§fn wide_signed(value: i128) -> Self::Expr
fn wide_signed(value: i128) -> Self::Expr
As Node::wide_unsigned: a bigint is unbounded, so a
negative pattern is written as the negative number it is.
Source§fn header_field(value: Self::Expr, field: &str) -> Self::Expr
fn header_field(value: Self::Expr, field: &str) -> Self::Expr
A field of a header the runtime handed back, in the runtime’s own
spelling — the same camelCase table
crates/lang-rules/src/emit/typescript.rs’s override carries,
because runtime/node/zdwire.js’s headers are plain objects with
the same property names as runtime/typescript’s.
Source§fn call(callee: &str, args: Vec<Self::Expr>) -> Self::Expr
fn call(callee: &str, args: Vec<Self::Expr>) -> Self::Expr
strcmp is the walk’s name for a three-way code-unit comparison;
JavaScript’s </> on strings already compare UTF-16 code units
(ECMA-262 §7.2.13), so the spelling is a ternary — the same one
crates/lang-rules/src/emit/typescript.rs writes, and the Java
column’s caveat about supplementary code points applies
unchanged.
A ternary and not the shorter (l < r) - (l > r): subtracting
two relational results goes through Boolean’s numeric
coercion, where true - false is 1 (ECMA-262 §7.1.4), so
that form returns +1 for the case C11 §7.24.4 gives -1.
The walk reads the result as strcmp(..) < 0, so the inverted
sign puts a map’s entries on the wire in descending key
order.
Source§fn carries_hdds_axes() -> bool
fn carries_hdds_axes() -> bool
runtime/node carries the three HDDS axes: beginPackedElement and
finishPackedElement on the writer and the reader, the DHEADER pair
for a sequence element’s own length, and writeWstringUtf8Octets /
readWstringUtf8Octets.
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 the generated file reaches through the runtime’s
own object: zdwire.<method>(args).
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 member 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
v[i] — a plain subscript; there is no noUncheckedIndexedAccess
assertion to write outside TypeScript.
Source§fn count_of(base: &str, fixed: Option<u64>) -> Self::Expr
fn count_of(base: &str, fixed: Option<u64>) -> Self::Expr
.length, or the bound where the materialiser fixed one.
Source§fn case_member(base: &str, field: &str) -> Self::Expr
fn case_member(base: &str, field: &str) -> Self::Expr
v.one — a union’s branches sit beside _d on one plain object;
nothing here needs the narrowing
crate::emit::typescript::TypeScript::case_member’s Extract<>
exists for, because nothing checks the type before the property
is read.
Source§fn materialised(_value: Self::Expr) -> Option<Self::Expr>
fn materialised(_value: Self::Expr) -> Option<Self::Expr>
Nothing: every string and array this runtime materialises either
exists or the read has already thrown — there is no allocator
that can hand back an absent one for a codec to notice, exactly
as crates/lang-rules/src/emit/lua.rs’s answer states for Lua’s
tables.
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: v.x is the value or the key is not there,
and there is no wrapper to unwrap.
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>
delete v.field for absence, and nothing for presence — writing
the member is what makes it present, exactly as
crates/lang-rules/src/emit/typescript.rs’s override reads;
crate::default_node writes the same shape for the same
clause.
Source§fn clear_union_cases(base: &str, fields: &[String]) -> Vec<Self::Stmt>
fn clear_union_cases(base: &str, fields: &[String]) -> Vec<Self::Stmt>
delete v.field for every case: adapter/node.rs puts a union’s
branches beside _d on one plain object, and a branch the
discriminator does not select is a property that is not there. The same statement as an absent
@optional member, Self::set_present with false.
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
== becomes === and != becomes !==.
Not house style: JavaScript’s loose equality coerces across
number and bigint inconsistently — 1 == 1n is true and
1 === 1n is false — and a discriminator compared with the
loose form could match a label of the wrong holder. && and
|| are already this language’s own spelling and pass through
unchanged, unlike crate::emit::lua::Lua::binary’s and/or.
Source§fn unary(op: &'static str, value: Self::Expr) -> Self::Expr
fn unary(op: &'static str, value: Self::Expr) -> Self::Expr
Every operator as given: JavaScript has a real unary form for
both ! and ~, so neither needs a stand-in.
Source§fn cast(type_: Self::Type, value: Self::Expr) -> Self::Expr
fn cast(type_: Self::Type, value: Self::Expr) -> Self::Expr
A conversion where the target is one of the three scalar holders
or the signed-char marker, a rewritten literal where the value
is a boolean discriminator’s, and the value unchanged everywhere
else — there is no as to fall back on and none is needed: a
value this seam does not name a coercion for already carries the
representation its destination wants.
"signed char" is the walk’s own reading of a map’s char key
order: the member holds the code point as a string, so
((k.charCodeAt(0) + 128) % 256) - 128 is the two’s-complement
wrap over its one octet — the same arithmetic
crates/lang-rules/src/emit/python.rs’s signed_char writes and
for the same reason.
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
The same conversion, at the point a value reaches its member: the
module documentation says why a wchar needs it here as well as
at Node::cast’s own call sites.
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_dec_T(r, zd_tc); — this column’s decoders answer
with the value, so the destination is the assignment’s left-hand
side and never an out-parameter.
Source§fn read_forward(callee: &str) -> Self::Stmt
fn read_forward(callee: &str) -> Self::Stmt
v = zd_dec_T(r, zd_tc); — a typedef, handed straight on.
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
let name = value;, with an integer literal spelled the way the
declared holder reads it — let bits = 0n; for a bigint
accumulator, exactly as the walk’s own
T::declare(T::scalar(Scalar::UInt64), "bits", int(0)) for a
bitset needs.
Source§fn mark_used(_name: &str) -> Vec<Self::Stmt>
fn mark_used(_name: &str) -> Vec<Self::Stmt>
Nothing: plain JavaScript has no unread-parameter diagnostic, and
zd_tc; is not worth writing on its own.
Source§fn drop_value(value: Self::Expr) -> Self::Stmt
fn drop_value(value: Self::Expr) -> Self::Stmt
void v; — the one form JavaScript has for “read and discard”,
and the only place the walk needs it.
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>
v = new Array(count);, 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 object to exist first. A
sequence’s element decoder assigns the slot outright and needs
only the outer array.
Source§fn storage(_type_: Self::Type, name: &str) -> Self::Stmt
fn storage(_type_: Self::Type, name: &str) -> Self::Stmt
let name = {}; — somewhere to put a value before its halves
arrive, so zd_scratch.key = … does not assign onto undefined.
Source§fn keep_first(base: &str, count: Self::Expr) -> Vec<Self::Stmt>
fn keep_first(base: &str, count: Self::Expr) -> Vec<Self::Stmt>
v.length = n;, which shortens an array in place. §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 around it: a JavaScript array element is a real place at every element type.
Source§fn routine(spec: Routine<Self>) -> Option<Self::Decl>
fn routine(spec: Routine<Self>) -> Option<Self::Decl>
function zd_enc_T(w, v) { … }, or the reading form that opens
from Table 9 and returns the sample.
A top-level declaration, in module scope: nothing this column
generates is exported, because the probe that runs it is a
script and not a package.
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_node::member_default: a @default this
column cannot spell as a JavaScript 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
a_b_Colour.RED — the flattened frozen object
crate::adapter::node declared, read from the file’s own
top-level scope.
The trait’s default answers the bare enumerator name prefixed by
Node::module_prefix, which is the empty string here — this
column flattens a declared type’s whole scoped name into its one
binding instead, and the enumerator lives inside that binding’s
own object.
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 map_entry_name(_ast: &Ast, _id: Id<TypeNode>) -> String
fn map_entry_name(_ast: &Ast, _id: Id<TypeNode>) -> String
map’s entry type. Read moreSource§fn runtime(receiver: &str, method: &str, args: Vec<Self::Expr>) -> Self::Expr
fn runtime(receiver: &str, method: &str, args: Vec<Self::Expr>) -> Self::Expr
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 entry_half(entry: Self::Expr, key: bool) -> Self::Expr
fn entry_half(entry: Self::Expr, key: bool) -> Self::Expr
map’s entry. Read moreSource§fn present(base: &str, field: &str) -> Self::Expr
fn present(base: &str, field: &str) -> Self::Expr
@optional member is present. Read moreSource§fn optional_destination(
base: &str,
field: &str,
) -> (Vec<Self::Stmt>, Self::Expr)
fn optional_destination( base: &str, field: &str, ) -> (Vec<Self::Stmt>, Self::Expr)
@optional member’s value, and what it
takes to have somewhere to put it. Read moreSource§fn handoff(value: Self::Expr, _form: Handoff) -> Self::Expr
fn handoff(value: Self::Expr, _form: Handoff) -> Self::Expr
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 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
bound, exclusive. Read moreSource§fn until(condition: Self::Expr, body: Self::Block) -> Self::Stmt
fn until(condition: Self::Expr, body: Self::Block) -> Self::Stmt
Source§fn bool_less(left: Self::Expr, right: Self::Expr) -> Self::Expr
fn bool_less(left: Self::Expr, right: Self::Expr) -> Self::Expr
left is less than right as boolean map keys —
false before true, the ascending-key order’s reading of the
one-octet wire value. Read moreSource§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 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.