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 · Source§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<'de, T, M> Deserialize<'de> for CuStampedData<T, M>
impl<'de, T, M> Deserialize<'de> for CuStampedData<T, M>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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> UnsafeUnpin for CuStampedData<T, M>where
M: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, M> UnwindSafe for CuStampedData<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CuPayloadSize for Twhere
T: CuMsgPayload,
impl<T> CuPayloadSize for Twhere
T: CuMsgPayload,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> TypeData for T
impl<T> TypeData for T
§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.