pub struct HeaderBlock {Show 16 fields
pub header: BlockHeader,
pub first_dg_addr: u64,
pub file_history_addr: u64,
pub channel_tree_addr: u64,
pub first_attachment_addr: u64,
pub first_event_addr: u64,
pub comment_addr: u64,
pub abs_time: u64,
pub tz_offset: i16,
pub daylight_save_time: i16,
pub time_flags: u8,
pub time_quality: u8,
pub flags: u8,
pub reserved1: u8,
pub start_angle: u64,
pub start_distance: u64,
}Fields§
§header: BlockHeader§first_dg_addr: u64§file_history_addr: u64§channel_tree_addr: u64§first_attachment_addr: u64§first_event_addr: u64§comment_addr: u64§abs_time: u64§tz_offset: i16§daylight_save_time: i16§time_flags: u8§time_quality: u8§flags: u8§reserved1: u8§start_angle: u64§start_distance: u64Implementations§
Source§impl HeaderBlock
impl HeaderBlock
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, MdfError>
pub fn to_bytes(&self) -> Result<Vec<u8>, MdfError>
Serializes the HeaderBlock to bytes according to MDF 4.1 specification.
§Structure (104 bytes total):
- BlockHeader (24 bytes): Standard block header with id “##HD”
- Link section (48 bytes): Six 8-byte links to other blocks
- first_dg_addr: Link to first Data Group block
- file_history_addr: Link to file history block
- channel_tree_addr: Link to channel hierarchy tree
- first_attachment_addr: Link to first attachment block
- first_event_addr: Link to first event block
- comment_addr: Link to comment block
- Time section (16 bytes): Timestamp and timezone information
- Angle/Distance section (16 bytes): Start values for angle and distance
§Returns
Ok(Vec<u8>)containing the serialized header blockErr(MdfError)if serialization fails
§Important
- The header must have id=“##HD” and block_len=104
- Links will typically be updated after all blocks are written
Trait Implementations§
Source§impl BlockParse<'_> for HeaderBlock
impl BlockParse<'_> for HeaderBlock
Source§impl Debug for HeaderBlock
impl Debug for HeaderBlock
Auto Trait Implementations§
impl Forget for HeaderBlock
impl Freeze for HeaderBlock
impl Move for HeaderBlock
impl RefUnwindSafe for HeaderBlock
impl Send for HeaderBlock
impl Sync for HeaderBlock
impl Unpin for HeaderBlock
impl UnsafeUnpin for HeaderBlock
impl UnwindSafe for HeaderBlock
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