pub enum FixedDigits {
Declared,
ValuePrecision,
ValueStringDigits,
}Expand description
How many BCD digits a fixed<P, S> puts on the wire.
CORBA 3.3 part 2 §9.3.2.8 packs a fixed as BCD nibbles followed by a
sign nibble, and leaves the digit count to the implementation. Two answers
exist in the field and both are self-consistent, so this is a dialect axis
and not a defect: omniORB writes the declared P whatever the value is,
while JacORB and ACE/TAO write as many digits as the value has.
The same two values live in zerodds_ast_layout::key::FixedDigitCount,
which is where a plan chooses between them. This copy exists because a
Writer must not depend on the layout planner — the same reason
WcharFraming sits here.
Variants§
Declared
P digits, whatever the value is. omniORB 4.3.3.
ValuePrecision
As many digits as the value has, never fewer than one. JacORB 3.9.
ValueStringDigits
The integer digits of the decimal as written, leading zeros
included, plus the S fraction digits, padded to an odd digit
count by adding one leading zero if the count is even. ACE/TAO
2.5.24’s ACE_CDR::Fixed for a decimal with S fraction digits,
through its own CDR operator. Measured in
unspecified_constructs.md §3. OpenDDS writes the declared count.
Implementations§
Source§impl FixedDigits
impl FixedDigits
Sourcepub const fn wire_digits(
self,
declared: u8,
significant: u8,
string_digits: u8,
) -> u8
pub const fn wire_digits( self, declared: u8, significant: u8, string_digits: u8, ) -> u8
How many digit nibbles a value goes out with.
declared is P; significant is the value’s digit count with
its leading zeros removed; string_digits is the digit count of
the input string. The byte-layer half of
zerodds_ast_layout::key::FixedDigitCount::wire_digits, and
crates/ast-layout/tests/fixed_digits_agree.rs holds the two halves
against each other over every argument either can take — a copy that
nothing compares is a copy that drifts.
Never zero under any value: a field of no digits could not carry the sign nibble’s pair.