Skip to main content

DataSubmessage

Struct DataSubmessage 

Source
pub struct DataSubmessage {
    pub extra_flags: u16,
    pub reader_id: EntityId,
    pub writer_id: EntityId,
    pub writer_sn: SequenceNumber,
    pub inline_qos: Option<ParameterList>,
    pub key_flag: bool,
    pub non_standard_flag: bool,
    pub serialized_payload: Arc<[u8]>,
}
Expand description

DATA-Submessage. Phase 0 unterstuetzt nur D-Flag (Daten), kein Q (kein Inline-QoS), kein K, kein N.

serialized_payload ist Arc<[u8]> (WP 2.0a Zero-Copy-Spike). Writer teilen sich die Payload-Allocation mit CacheChange und allen DATA/DATA_FRAG-Datagrammen — clone() auf dieser Struct ist ein reiner Refcount-Bump.

Fields§

§extra_flags: u16

Reserved Extra-Flags (uint16, meist 0).

§reader_id: EntityId

Empfaenger-EntityId.

§writer_id: EntityId

Sender-EntityId.

§writer_sn: SequenceNumber

Sequence-Number dieser DATA.

§inline_qos: Option<ParameterList>

Inline-QoS-ParameterList (Q-Flag, §9.4.5.3.2). None = kein Q-Flag, kein Inline-QoS-Block. Trager fuer PID_KEY_HASH (WP 1.B), PID_STATUS_INFO, PID_COHERENT_SET etc.

§key_flag: bool

K-Flag (Spec §8.3.8.2 Tab. 8.43). true: serialized_payload enthaelt nur die @key-Felder (key-only Sample, z.B. dispose- Marker). Der D-Flag kann gleichzeitig false sein, wenn nur Key gesendet wird; in dem Fall ist serialized_payload ein XCDR-codierter Key-Holder.

§non_standard_flag: bool

N-Flag (Spec §8.3.8.2 Tab. 8.43, NonStandardPayloadFlag). true: serialized_payload ist NICHT in der durch representation_identifier impliziten CDR-Variante codiert (z.B. fuer DDS-Security-encrypted Payloads).

§serialized_payload: Arc<[u8]>

Serialisierter Payload (XCDR2-codiert oder vendor-spezifisch).

Implementations§

Source§

impl DataSubmessage

Source

pub fn write_body(&self, little_endian: bool) -> (Vec<u8>, u8)

Encoded den DATA-Body (ohne Submessage-Header) in einen Vec. Setzt automatisch das D-Flag und ggf. das Q-Flag im flags-Output (rueckgegeben), damit der Caller den Submessage-Header korrekt fuellen kann.

Layout: extraFlags(2) + octetsToInlineQos(2) + readerId(4) + writerId(4) + writerSN(8) + [optional InlineQoS-PL] + payload.

Source

pub fn read_body(body: &[u8], little_endian: bool) -> Result<Self, WireError>

Decoded den DATA-Body aus einem Slice. Backward-Compat-Wrapper fuer Caller, die kein Q-Flag tragen — Inline-QoS wird ignoriert.

§Errors

UnexpectedEof bei zu kurzem Body.

Source

pub fn read_body_with_flags( body: &[u8], little_endian: bool, flags: u8, ) -> Result<Self, WireError>

Decoded den DATA-Body unter Beruecksichtigung der Submessage-Flags. Wenn flags & DATA_FLAG_INLINE_QOS != 0 parst der Decoder die ParameterList nach dem writerSN, vor dem Payload.

§Errors

UnexpectedEof bei zu kurzem Body. ParameterList-Fehler werden als WireError durchgereicht.

Trait Implementations§

Source§

impl Clone for DataSubmessage

Source§

fn clone(&self) -> DataSubmessage

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 Debug for DataSubmessage

Source§

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

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

impl PartialEq for DataSubmessage

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DataSubmessage

Source§

impl StructuralPartialEq for DataSubmessage

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.