-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
340 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//! Specialized element types of arrays | ||
|
||
/// Represent a calendar interval as days and milliseconds | ||
#[derive(Debug, PartialEq, Clone, Copy, bytemuck::AnyBitPattern, bytemuck::NoUninit)] | ||
#[repr(C)] | ||
pub struct DayTimeInterval { | ||
/// The number of days in the interval | ||
pub days: i32, | ||
/// The number of milliseconds in the interval | ||
pub milliseconds: i32, | ||
} | ||
|
||
/// Represent a calendar interval as months, days and nanoseconds | ||
#[derive(Debug, PartialEq, Clone, Copy, bytemuck::AnyBitPattern, bytemuck::NoUninit)] | ||
#[repr(C)] | ||
pub struct MonthDayNanoInterval { | ||
/// The number of months in the interval | ||
pub months: i32, | ||
/// The number of days in the interval | ||
pub days: i32, | ||
/// The number of nanoseconds in the interval | ||
pub nanoseconds: i64, | ||
} | ||
|
||
#[test] | ||
fn interval_sizes() { | ||
assert_eq!( | ||
std::mem::size_of::<DayTimeInterval>(), | ||
std::mem::size_of::<i64>() | ||
); | ||
assert_eq!( | ||
std::mem::size_of::<MonthDayNanoInterval>(), | ||
std::mem::size_of::<i128>() | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.