pub struct DltLogWriter { /* private fields */ }Expand description
Builder for structured log messages with multiple typed fields
Construct log messages with typed data fields sent in binary format for efficiency. Each field retains type information for proper display in DLT viewers.
§Usage
- Start with
DltContextHandle::log_write_start() - Chain
write_*methods to add fields - Call
finish()to send
Auto-finishes on drop if finish() not called (errors ignored).
§Example
"Measurement and Bus Trace Interface")?;
let mut writer = ctx.log_write_start(DltLogLevel::Info)?;
writer.write_string("Temperature:")?
.write_float32(87.5)?
.write_string("°C")?;
writer.finish()?;§Available Methods
write_string() |
write_i32() |
write_u32() |
write_int64() |
write_uint64() |
write_float32() |
write_float64() |
write_bool()
Implementations§
Source§impl DltLogWriter
impl DltLogWriter
Sourcepub fn write_string(&mut self, text: &str) -> Result<&mut Self, DltSysError>
pub fn write_string(&mut self, text: &str) -> Result<&mut Self, DltSysError>
Sourcepub fn write_u32(&mut self, value: u32) -> Result<&mut Self, DltSysError>
pub fn write_u32(&mut self, value: u32) -> Result<&mut Self, DltSysError>
Sourcepub fn write_i32(&mut self, value: i32) -> Result<&mut Self, DltSysError>
pub fn write_i32(&mut self, value: i32) -> Result<&mut Self, DltSysError>
Sourcepub fn write_uint64(&mut self, value: u64) -> Result<&mut Self, DltSysError>
pub fn write_uint64(&mut self, value: u64) -> Result<&mut Self, DltSysError>
Sourcepub fn write_int64(&mut self, value: i64) -> Result<&mut Self, DltSysError>
pub fn write_int64(&mut self, value: i64) -> Result<&mut Self, DltSysError>
Sourcepub fn write_float32(&mut self, value: f32) -> Result<&mut Self, DltSysError>
pub fn write_float32(&mut self, value: f32) -> Result<&mut Self, DltSysError>
Sourcepub fn write_float64(&mut self, value: f64) -> Result<&mut Self, DltSysError>
pub fn write_float64(&mut self, value: f64) -> Result<&mut Self, DltSysError>
Sourcepub fn write_bool(&mut self, value: bool) -> Result<&mut Self, DltSysError>
pub fn write_bool(&mut self, value: bool) -> Result<&mut Self, DltSysError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DltLogWriter
impl RefUnwindSafe for DltLogWriter
impl !Send for DltLogWriter
impl !Sync for DltLogWriter
impl Unpin for DltLogWriter
impl UnwindSafe for DltLogWriter
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