Skip to main content

WirePosition

Enum WirePosition 

Source
pub enum WirePosition {
    Member,
    Element,
    Discriminator,
    KeyHolderMember,
    Sentinel,
    ExtendedMarker,
}
Expand description

Where a wchar is reached from.

The one axis WcharFraming varies along, and the reason it exists is a measurement rather than a symmetry: tao_idl writes GIOP 1.2’s length octet for a wchar member and no length octet for a wchar inside an array or a sequence. Nothing else in this crate’s layout varies with position, so this enum is deliberately small and deliberately not a general traversal context.

Variants§

§

Member

Reached as a member of a structure, a union branch, or as the whole of a top-level value. The default, because it is the position every value was in before collections were measured.

Measured on WcharFraming — tao_idl writes GIOP 1.2’s length octet here and not at Self::Element — and on WstringLengthPolicy, where it is measured to agree with Self::Element in all nine implementations.

§

Element

Reached as an element of an array or a sequence.

A wstring’s code units are not this: they are not wchars on the wire at all and are laid out by WstringLengthPolicy.

Measured on WcharFraming and on WstringLengthPolicy; see Self::Member.

§

Discriminator

The discriminator of a union.

Prospective. No axis has been measured to answer this differently from Self::Member. It is here because a discriminator is reached by a path of its own in every emitter, so an axis that starts varying with it has somewhere to say so without a signature change.

§

KeyHolderMember

A key holder’s copy of a member.

Prospective. KeyHolderExtensibility and KeyHolderOrder are today whole-holder settings rather than per-position ones; if a per-member difference is ever measured this is where it lands.

§

Sentinel

The sentinel that closes an XCDR1 parameter list.

Measured on PidFlagPolicy, which is the axis that reads this variant: PidFlagPolicy::must_understand_at and PidFlagPolicy::impl_extension_at both take a position, the writer asks them at Self::Member for a member id and here for PID_LIST_END, and the four implementations’ answers differ between the two positions. The measurement is on PidFlagPolicy.

§

ExtendedMarker

The PID_EXTENDED marker that opens an XCDR1 parameter’s extended header.

Measured on PidFlagPolicy. The flag was PlCdr1HeaderPolicy::marker_must_understand, on the argument that the marker exists only under PlCdr1HeaderPolicy::AlwaysExtended and its flag is therefore a property of the form. Eight recorded rows contradict that: xcdr.rs::needs_extended_pid writes the marker under PlCdr1HeaderPolicy::Specification too — for a member id above PID_SHORT_MAX_ID or a value the short length cannot hold — and the four implementations answer it as follows, on annotation-hashid-implicit and annotation-id-sparse:

implementation  framing form       the marker
Cyclone         AlwaysExtended     7f01
RTI             Specification      7f01
Fast DDS        ShortTrueLength    3f01
OpenDDS         ShortTrueLength    ff01  — with FLAG_IMPL_EXTENSION

Two forms answer alike and two forms answer differently, which is judgement 3 of docs/wire-axes-followup.md: a field two forms answer differently and two forms answer alike is not a field of the form. The three PidFlagPolicy values answer all four implementations here with no fourth value.

Implementations§

Source§

impl WirePosition

Source

pub const ALL: [Self; 6]

Every position.

Source

pub const MEASURED: [Self; 4]

The positions on which some axis has a measured difference or a measured agreement, as against those carried prospectively.

Kept apart because measured and provided-for must not look alike: a reader who cannot tell them apart reads the next measurement as a confirmation of something that was never checked. Self::Member and Self::Element are measured on WcharFraming (they differ) and on WstringLengthPolicy (they agree, in nine implementations); Self::Sentinel and Self::ExtendedMarker are measured on PidFlagPolicy, which reads both. The other two are prospective.

Source

pub const fn is_measured(self) -> bool

Whether some axis has been measured at this position.

Source

pub const fn is_member(self) -> bool

Whether this is the member position.

Source

pub const fn as_str(self) -> &'static str

Short name, for configuration and diagnostics.

Source

pub const fn inside_collection() -> Self

The position an element of a collection is reached in.

A named constructor rather than a literal at the call sites so that “descending into a collection” is one decision written once: a sequence of arrays of wchar reaches the same answer as an array of wchar, and neither has to say so itself.

Source

pub const fn inside(self) -> Self

The position the members of an aggregate are reached in.

An aggregate resets the position: a wchar member of a struct that is itself an array element takes the member’s framing, because tao_idl reaches it through the struct’s own marshaller. Unmeasured against TAO — the corpus has no such case — and it is the reading the generated code’s shape gives, recorded here so that the day a case is added there is something to contradict.

Trait Implementations§

Source§

impl Clone for WirePosition

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WirePosition

Source§

impl Debug for WirePosition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WirePosition

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for WirePosition

Source§

impl Hash for WirePosition

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for WirePosition

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for WirePosition

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for WirePosition

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for WirePosition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.