-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wip] refactor towards a design where a minimal set of traits defines…
… data types, and then FieldCopyAccess and FieldView are defined based on those
- Loading branch information
Showing
12 changed files
with
791 additions
and
704 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pub trait DataTypeMetadata { | ||
const SIZE: Option<usize>; | ||
} | ||
|
||
pub mod primitive; |
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
137 changes: 48 additions & 89 deletions
137
...ds/primitive/copy_access/primitive_int.rs → src/data_types/primitive/int.rs
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,20 @@ | ||
use crate::endianness::Endianness; | ||
|
||
pub trait PrimitiveRead: Sized { | ||
type Error; | ||
|
||
fn try_read<E: Endianness>(storage: &[u8]) -> Result<Self, Self::Error>; | ||
} | ||
|
||
pub trait PrimitiveWrite: Sized { | ||
type Error; | ||
|
||
fn try_write<E: Endianness>(self, storage: &mut [u8]) -> Result<(), Self::Error>; | ||
} | ||
|
||
mod float; | ||
mod int; | ||
mod nonzero_int; | ||
mod unit; | ||
|
||
pub use nonzero_int::NonZeroIsZeroError; |
Oops, something went wrong.