btrfs_diskformat/core/time.rs
1use {
2 byteorder::LE,
3 static_assertions::const_assert_eq,
4 zerocopy::{AsBytes, FromBytes, Unaligned, I64, U32},
5};
6
7/// The layout of timestamps on disk.
8#[derive(Copy, Clone, Debug, AsBytes, FromBytes, Unaligned)]
9#[repr(C, packed)]
10pub struct Time {
11 /// The timestamp using Unix time convention.
12 pub timestamp: I64<LE>,
13
14 /// The number of nanoseconds past the beginning of the second denoted in [timestamp].
15 ///
16 /// [timestamp]: Time::timestamp
17 pub nanoseconds: U32<LE>,
18}
19const_assert_eq!(core::mem::size_of::<Time>(), 12);