Struct rustdds::dds::with_key::DataSample [−][src]
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]
D: Keyed,
pub fn get_key(&self) -> D::K where
<D as Keyed>::K: Key,
[src]
<D as Keyed>::K: Key,
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]
D::K: Debug,
impl<D: PartialEq + Keyed> PartialEq<DataSample<D>> for DataSample<D> where
D::K: PartialEq,
[src]
D::K: PartialEq,
fn eq(&self, other: &DataSample<D>) -> bool
[src]
fn ne(&self, other: &DataSample<D>) -> bool
[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]
D: RefUnwindSafe,
<D as Keyed>::K: RefUnwindSafe,
impl<D> Send for DataSample<D> where
D: Send,
<D as Keyed>::K: Send,
[src]
D: Send,
<D as Keyed>::K: Send,
impl<D> Sync for DataSample<D> where
D: Sync,
<D as Keyed>::K: Sync,
[src]
D: Sync,
<D as Keyed>::K: Sync,
impl<D> Unpin for DataSample<D> where
D: Unpin,
<D as Keyed>::K: Unpin,
[src]
D: Unpin,
<D as Keyed>::K: Unpin,
impl<D> UnwindSafe for DataSample<D> where
D: UnwindSafe,
<D as Keyed>::K: UnwindSafe,
[src]
D: UnwindSafe,
<D as Keyed>::K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,