Struct rustdds::dds::with_key::DataSample[][src]

pub struct DataSample<D: Keyed> { /* fields omitted */ }

DDS spec 2.2.2.5.4

Note that no_key::DataSample and with_key::DataSample are two different but similar structs.

We are making a bit unorthodox use of Result: It replaces the use of valid_data flag, because when valid_data = false, we should not provide any data value. Now

  • Ok(D) means valid_data = true and there is a sample.
  • Err(D::K) means valid_data = false, no sample exists, but only a Key and instance_state has changed.

Implementations

impl<D> DataSample<D> where
    D: Keyed
[src]

pub fn get_key(&self) -> D::K where
    <D as Keyed>::K: Key
[src]

pub fn value(&self) -> &Result<D, D::K>[src]

pub fn into_value(self) -> Result<D, D::K>[src]

pub fn sample_info(&self) -> &SampleInfo[src]

pub fn sample_info_mut(&mut self) -> &mut SampleInfo[src]

Trait Implementations

impl<D: Debug + Keyed> Debug for DataSample<D> where
    D::K: Debug
[src]

impl<D: PartialEq + Keyed> PartialEq<DataSample<D>> for DataSample<D> where
    D::K: PartialEq
[src]

impl<D: Keyed> StructuralPartialEq for DataSample<D>[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for DataSample<D> where
    D: RefUnwindSafe,
    <D as Keyed>::K: RefUnwindSafe
[src]

impl<D> Send for DataSample<D> where
    D: Send,
    <D as Keyed>::K: Send
[src]

impl<D> Sync for DataSample<D> where
    D: Sync,
    <D as Keyed>::K: Sync
[src]

impl<D> Unpin for DataSample<D> where
    D: Unpin,
    <D as Keyed>::K: Unpin
[src]

impl<D> UnwindSafe for DataSample<D> where
    D: UnwindSafe,
    <D as Keyed>::K: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,