pub struct DltMessage {
pub index: DltMessageIndexType,
pub reception_time_us: u64,
pub ecu: DltChar4,
pub timestamp_dms: u32,
pub standard_header: DltStandardHeader,
pub extended_header: Option<DltExtendedHeader>,
pub payload: Vec<u8>,
pub payload_text: Option<String>,
pub lifecycle: LifecycleId,
}Fields§
§index: DltMessageIndexType§reception_time_us: u64§ecu: DltChar4§timestamp_dms: u32§standard_header: DltStandardHeader§extended_header: Option<DltExtendedHeader>§payload: Vec<u8>§payload_text: Option<String>§lifecycle: LifecycleIdImplementations§
Source§impl DltMessage
impl DltMessage
pub fn timestamp_us(&self) -> u64
pub fn reception_time(&self) -> NaiveDateTime
pub fn mcnt(&self) -> u8
Sourcepub fn mstp(&self) -> DltMessageType
pub fn mstp(&self) -> DltMessageType
return the message type based on the extended header info. If the message has no extended header Log/Fatal is used as default.
Sourcepub fn is_ctrl_request(&self) -> bool
pub fn is_ctrl_request(&self) -> bool
return whether the message is a CONTROL_REQUEST message
Sourcepub fn is_ctrl_response(&self) -> bool
pub fn is_ctrl_response(&self) -> bool
return whether the message is a CONTROL_RESPONSE message
Sourcepub fn noar(&self) -> u8
pub fn noar(&self) -> u8
return number of args from extended header. Returns 0 if no ext header is avail.
Sourcepub fn is_verbose(&self) -> bool
pub fn is_verbose(&self) -> bool
return whether message has verbose mode (from ext header). false if no ext header.
Sourcepub fn verb_mstp_mtin(&self) -> Option<u8>
pub fn verb_mstp_mtin(&self) -> Option<u8>
return verb_mstp_mtin field from ext header. None if no ext header
pub fn from_headers( index: DltMessageIndexType, storage_header: DltStorageHeader, standard_header: DltStandardHeader, add_header_buf: &[u8], payload: Vec<u8>, ) -> DltMessage
Sourcepub fn to_write(&self, writer: &mut impl Write) -> Result<(), Error>
pub fn to_write(&self, writer: &mut impl Write) -> Result<(), Error>
write the msg to a writer as a DLT file byte stream
- storage header
- standard header
- extended header
- payload Doesn’t try to do “atomic” writes, might fail on io errors with partial writes. session_id not supported yet. Payload endian format is taken from the msg.
pub fn header_as_text_to_write<T: Write>( &self, writer: &mut T, ) -> Result<(), Error>
Sourcepub fn set_payload_text(&mut self, text: String)
pub fn set_payload_text(&mut self, text: String)
overwrite the payload text
this is intended to be used by e.g. plugins to modify the payload text for now we use a 2nd variable but we could as well simply modify the payload todo think about better ways (pros/cons)
pub fn payload_as_text(&self) -> Result<String, Error>
Sourcepub fn get_testmsg_with_payload(
big_endian: bool,
noar: u8,
payload_buf: &[u8],
) -> DltMessage
pub fn get_testmsg_with_payload( big_endian: bool, noar: u8, payload_buf: &[u8], ) -> DltMessage
return a verbose dltmessage with the noar and payload
should only be used for testing
ECU1/APID/CTID is used
pub fn is_big_endian(&self) -> bool
pub fn apid(&self) -> Option<&DltChar4>
pub fn ctid(&self) -> Option<&DltChar4>
Trait Implementations§
Source§impl Debug for DltMessage
impl Debug for DltMessage
Source§impl<'a> IntoIterator for &'a DltMessage
impl<'a> IntoIterator for &'a DltMessage
Source§impl PartialEq for DltMessage
impl PartialEq for DltMessage
impl Eq for DltMessage
impl StructuralPartialEq for DltMessage
Auto Trait Implementations§
impl Freeze for DltMessage
impl RefUnwindSafe for DltMessage
impl Send for DltMessage
impl Sync for DltMessage
impl Unpin for DltMessage
impl UnwindSafe for DltMessage
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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.