pub struct CuStampedData<T, M>where
T: CuMsgPayload,
M: Metadata,{
pub tov: Tov,
pub metadata: M,
/* private fields */
}Expand description
CuMsg is the envelope holding the msg payload and the metadata between tasks.
Fields§
§tov: TovThe time of validity of the message. It can be undefined (None), one measure point or a range of measures (TimeRange).
metadata: MThis metadata is the data that is common to all messages.
Implementations§
Source§impl<T, M> CuStampedData<T, M>where
T: CuMsgPayload,
M: Metadata,
impl<T, M> CuStampedData<T, M>where
T: CuMsgPayload,
M: Metadata,
pub fn new(payload: Option<T>) -> Self
pub fn payload(&self) -> Option<&T>
pub fn set_payload(&mut self, payload: T)
pub fn clear_payload(&mut self)
pub fn payload_mut(&mut self) -> &mut Option<T>
Source§impl<T: CuMsgPayload> CuStampedData<T, CuMsgMetadata>
impl<T: CuMsgPayload> CuStampedData<T, CuMsgMetadata>
Sourcepub unsafe fn assume_payload<U: CuMsgPayload>(&self) -> &CuMsg<U>
pub unsafe fn assume_payload<U: CuMsgPayload>(&self) -> &CuMsg<U>
Reinterprets the payload type carried by this message.
§Safety
The caller must guarantee that the message really contains a payload of type U. Failing
to do so is undefined behaviour.
Sourcepub unsafe fn assume_payload_mut<U: CuMsgPayload>(&mut self) -> &mut CuMsg<U>
pub unsafe fn assume_payload_mut<U: CuMsgPayload>(&mut self) -> &mut CuMsg<U>
Mutable variant of assume_payload.
§Safety
The caller must guarantee that mutating the returned message is sound for the actual payload type stored in the buffer.
Source§impl<T: CuMsgPayload + 'static> CuStampedData<T, CuMsgMetadata>
impl<T: CuMsgPayload + 'static> CuStampedData<T, CuMsgMetadata>
Sourcepub fn downcast_ref<U: CuMsgPayload + 'static>(&self) -> CuResult<&CuMsg<U>>
pub fn downcast_ref<U: CuMsgPayload + 'static>(&self) -> CuResult<&CuMsg<U>>
Attempts to view this message as carrying payload U.
Sourcepub fn downcast_mut<U: CuMsgPayload + 'static>(
&mut self,
) -> CuResult<&mut CuMsg<U>>
pub fn downcast_mut<U: CuMsgPayload + 'static>( &mut self, ) -> CuResult<&mut CuMsg<U>>
Mutable variant of downcast_ref.
Trait Implementations§
Source§impl<'__de, T, M, __Context> BorrowDecode<'__de, __Context> for CuStampedData<T, M>where
T: CuMsgPayload + BorrowDecode<'__de, __Context>,
M: Metadata + BorrowDecode<'__de, __Context>,
impl<'__de, T, M, __Context> BorrowDecode<'__de, __Context> for CuStampedData<T, M>where
T: CuMsgPayload + BorrowDecode<'__de, __Context>,
M: Metadata + BorrowDecode<'__de, __Context>,
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<T, M> Clone for CuStampedData<T, M>
impl<T, M> Clone for CuStampedData<T, M>
Source§fn clone(&self) -> CuStampedData<T, M>
fn clone(&self) -> CuStampedData<T, M>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, M> Debug for CuStampedData<T, M>
impl<T, M> Debug for CuStampedData<T, M>
Source§impl<T, M, __Context> Decode<__Context> for CuStampedData<T, M>
impl<T, M, __Context> Decode<__Context> for CuStampedData<T, M>
Source§impl<T, M> Default for CuStampedData<T, M>
impl<T, M> Default for CuStampedData<T, M>
Source§fn default() -> CuStampedData<T, M>
fn default() -> CuStampedData<T, M>
Returns the “default value” for a type. Read more
Source§impl<T, M> Encode for CuStampedData<T, M>
impl<T, M> Encode for CuStampedData<T, M>
Source§impl<T, M> ErasedCuStampedData for CuStampedData<T, M>where
T: CuMsgPayload,
M: CuMsgMetadataTrait + Metadata,
impl<T, M> ErasedCuStampedData for CuStampedData<T, M>where
T: CuMsgPayload,
M: CuMsgMetadataTrait + Metadata,
Source§impl<T, M> Serialize for CuStampedData<T, M>
impl<T, M> Serialize for CuStampedData<T, M>
Auto Trait Implementations§
impl<T, M> Freeze for CuStampedData<T, M>
impl<T, M> RefUnwindSafe for CuStampedData<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M> Send for CuStampedData<T, M>
impl<T, M> Sync for CuStampedData<T, M>
impl<T, M> Unpin for CuStampedData<T, M>
impl<T, M> UnwindSafe for CuStampedData<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more