pub struct LogMetadata {
pub filename_raw: [u8; 16],
pub unknown_0x10: u16,
pub sample_count: u16,
pub interval: Time,
pub flags: u16,
pub recorded_duration: Time,
pub final_charge: ElectricCharge,
pub final_energy: Energy,
pub data_offset: u32,
pub reserved_tail: [u8; 8],
}Expand description
Metadata describing the offline log selected on the device.
Fields whose meaning has not been established are preserved verbatim and deliberately named after their wire position rather than guessed.
Fields§
§filename_raw: [u8; 16]§unknown_0x10: u16§sample_count: u16§interval: Time§flags: u16§recorded_duration: Time§final_charge: ElectricCharge§final_energy: Energy§data_offset: u32Offset from OFFLINE_LOG_ADDRESS at which this log’s samples begin.
reserved_tail: [u8; 8]Implementations§
Source§impl LogMetadata
impl LogMetadata
pub fn from_bytes(bytes: &[u8]) -> Result<Self, KMError>
Sourcepub fn filename_bytes(&self) -> &[u8] ⓘ
pub fn filename_bytes(&self) -> &[u8] ⓘ
Filename bytes up to the first NUL terminator.
pub fn filename(&self) -> Result<&str, Utf8Error>
pub fn filename_lossy(&self) -> Cow<'_, str>
pub const fn data_size(&self) -> u32
pub fn data_address(&self) -> Result<u32, KMError>
pub fn final_charge_raw_uah(&self) -> i32
pub fn final_energy_raw_uwh(&self) -> i32
Sourcepub fn calculated_duration(&self) -> Time
pub fn calculated_duration(&self) -> Time
Duration implied by the sample count and interval.
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for LogMetadata
impl Clone for LogMetadata
Source§impl Debug for LogMetadata
impl Debug for LogMetadata
Source§impl PartialEq for LogMetadata
impl PartialEq for LogMetadata
impl StructuralPartialEq for LogMetadata
Auto Trait Implementations§
impl Freeze for LogMetadata
impl RefUnwindSafe for LogMetadata
impl Send for LogMetadata
impl Sync for LogMetadata
impl Unpin for LogMetadata
impl UnsafeUnpin for LogMetadata
impl UnwindSafe for LogMetadata
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