Skip to main content

PidRead

Struct PidRead 

Source
pub struct PidRead {
    pub pid: u32,
    pub length: usize,
    pub end: bool,
    pub must_understand: bool,
    pub impl_extension: bool,
    pub reserved: bool,
    pub ignore: bool,
    /* private fields */
}
Expand description

A parameter header as read.

Fields§

§pid: u32

The parameter id, with the flag bits removed.

§length: usize

The value’s unpadded length.

§end: bool

Whether this is the list’s end.

§must_understand: bool

Whether the writer set the must-understand flag. Cyclone sets it on every parameter and Fast DDS on none; both are streams this project reads.

§impl_extension: bool

Whether the writer set FLAG_IMPL_EXTENSION.

XTypes 1.3 §7.4.1.2.2: the parameter is the writing implementation’s own, and a user-defined member “will never set the FLAG_IMPL_EXTENSION bit”. The flag used to be masked off with the rest, which made a vendor-private parameter indistinguishable from the user member sharing its low fourteen bits — and the vendor’s payload was then read into that member with no error.

§reserved: bool

Whether the id is inside the reserved range, which no member has.

§7.4.1.2.2 reserves 0x3F01 to 0x3FFF. PID_EXTENDED and PID_LIST_END are handled before this field is ever read; what is left is PID_IGNORE and the range above it, and none of them is a member id. A short parameter carrying one used to be matched against a member declared with that number through the extended header, where it is a legal id.

§ignore: bool

PID_IGNORE, which §7.4.1.2.2 says every consumer shall ignore.

Kept apart from PidRead::reserved because it outranks PidRead::must_understand: the clause has no exception in it, so a reader that discarded the sample over the flag would refuse a stream the clause tells it to accept.

Implementations§

Source§

impl PidRead

Source

pub const fn is_user_member(&self) -> bool

Whether this parameter can be one of the reading type’s members.

False for a vendor-private parameter and for one whose id is in the reserved range. Both are streams a conforming writer may send, and neither is any member of the type being read, so both take the unknown-parameter path — skipped, or the sample discarded if the writer set must-understand. XTypes 1.3 §7.4.1.2.2, §7.2.2.4.4.4.6.

Trait Implementations§

Source§

impl Clone for PidRead

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 PidRead

Source§

impl Debug for PidRead

Source§

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

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

impl Eq for PidRead

Source§

impl PartialEq for PidRead

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 StructuralPartialEq for PidRead

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.