added generic bounds

This commit is contained in:
cbax 2024-09-25 20:12:17 +00:00
parent 3faa26f43e
commit 1a00e6f5f9

View file

@ -63,7 +63,7 @@ impl From<u128> for Icechip<u128> {
} }
} }
impl<T> Icechip<T> { impl<T: Shl + Shr + Clone> Icechip<T> {
pub fn new(version: Version, epoch: Option<u64>) -> Icechip<T> { pub fn new(version: Version, epoch: Option<u64>) -> Icechip<T> {
todo!(); todo!();
} }
@ -73,7 +73,7 @@ impl<T> Icechip<T> {
self.epoch = Some(epoch); self.epoch = Some(epoch);
} }
pub fn tick(&self) -> Icechip<T> { pub fn tick<T: Shl + Shr + Clone>(&self) -> Icechip<T> {
/* /*
- if current timestamp in relation to self does not equal self, return an updated value, else increment the sequence - if current timestamp in relation to self does not equal self, return an updated value, else increment the sequence
- if sequence is going to overflow, sleep 1 ms - if sequence is going to overflow, sleep 1 ms