pub fn from<D>(data: &D, source_timestamp: Option<Timestamp>) -> DDSData
  where
    D: Keyed + Serialize,
  {
    let value = DDSData::serialize_data(data);

    let ts: Timestamp = match source_timestamp {
      Some(t) => t,
      None => Timestamp::now(),
    };

    let serialized_payload = SerializedPayload::new(RepresentationIdentifier::CDR_LE, value);

    DDSData {
      source_timestamp: ts,
      change_kind: ChangeKind::ALIVE,
      reader_id: EntityId::ENTITYID_UNKNOWN,
      writer_id: EntityId::ENTITYID_UNKNOWN,
      value: Some(serialized_payload),
      value_key_hash: 0,
    }
  }
// TODO: Rename this method, as it gets confued with the std library "From" trait method.
Rename this method, as it gets confued with the std library "From" trait method.
Rename this method as it gets confued with the std library " From " trait method .
pub fn from<D>(data: &D, source_timestamp: Option<Timestamp>) -> DDSData
  where
    D: Keyed + Serialize,
  {
    let value = DDSData::serialize_data(data);
    let ts: Timestamp = match source_timestamp {
      Some(t) => t,
      None => Timestamp::now(),
    };
    let serialized_payload = SerializedPayload::new(RepresentationIdentifier::CDR_LE, value);
    DDSData {
      source_timestamp: ts,
      change_kind: ChangeKind::ALIVE,
      reader_id: EntityId::ENTITYID_UNKNOWN,
      writer_id: EntityId::ENTITYID_UNKNOWN,
      value: Some(serialized_payload),
      value_key_hash: 0,
    }
  }
pub fn from < D > ( data : & D , source_timestamp : Option < Timestamp > ) -> DDSData where D : Keyed + Serialize , { let value = DDSData :: serialize_data ( data ) ; let ts : Timestamp = match source_timestamp { Some ( t ) => t , None => Timestamp :: now ( ) , } ; let serialized_payload = SerializedPayload :: new ( RepresentationIdentifier :: CDR_LE , value ) ; DDSData { source_timestamp : ts , change_kind : ChangeKind :: ALIVE , reader_id : EntityId :: ENTITYID_UNKNOWN , writer_id : EntityId :: ENTITYID_UNKNOWN , value : Some ( serialized_payload ) , value_key_hash : 0 , } }
TODO: Rename this method, as it gets confued with the std library "From" trait method.
TODO : Rename this method as it gets confued with the std library " From " trait method .
data
&D
source_timestamp
Option<Timestamp>