aboutsummaryrefslogtreecommitdiff
path: root/src/util/mem/types.rs
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-08-26 17:25:34 -0700
committerChristian Cunningham <cc@localhost>2022-08-26 17:25:34 -0700
commita04cf2dbb8d2e890405fbf0a1022aaad3015b1e8 (patch)
tree381892074d13c059d50cb88caa41f8a8722c07ce /src/util/mem/types.rs
parent7f3d7d9ce9818078b6a4616b4c31a28e2868397b (diff)
Modularize
Diffstat (limited to 'src/util/mem/types.rs')
-rw-r--r--src/util/mem/types.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/util/mem/types.rs b/src/util/mem/types.rs
new file mode 100644
index 0000000..ed22132
--- /dev/null
+++ b/src/util/mem/types.rs
@@ -0,0 +1,54 @@
+/// # u256 struct
+///
+/// 256 bit size field
+#[derive(Copy, Clone)]
+pub struct U256(u128, u128);
+impl U256 {
+ pub const fn new() -> Self {
+ U256(0, 0)
+ }
+}
+
+/// # u512 struct
+///
+/// 512 bit size field
+#[derive(Copy, Clone)]
+pub struct U512(U256, U256);
+impl U512 {
+ pub const fn new() -> Self {
+ U512(U256::new(), U256::new())
+ }
+}
+
+/// # u1024 struct
+///
+/// 1024 bit size field
+#[derive(Copy, Clone)]
+pub struct U1024(U512, U512);
+impl U1024 {
+ pub const fn new() -> Self {
+ U1024(U512::new(), U512::new())
+ }
+}
+
+/// # u2048 struct
+///
+/// 2048 bit size field
+#[derive(Copy, Clone)]
+pub struct U2048(U1024, U1024);
+impl U2048 {
+ pub const fn new() -> Self {
+ U2048(U1024::new(), U1024::new())
+ }
+}
+
+/// # u4096 struct
+///
+/// 4096 bit size field
+#[derive(Copy, Clone)]
+pub struct U4096(U2048, U2048);
+impl U4096 {
+ pub const fn new() -> Self {
+ U4096(U2048::new(), U2048::new())
+ }
+}