wip: refactor into fewer crates, pt.2
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-05-01 18:03:27 +03:00
parent 77703d83a5
commit 22d3cc5a5f
49 changed files with 1332 additions and 1316 deletions

View file

@ -0,0 +1,16 @@
mod clock_api; pub use self::clock_api::*;
mod clock_model; pub use self::clock_model::*;
pub trait HasClock: Send + Sync {
fn clock (&self) -> &Clock;
fn clock_mut (&mut self) -> &mut Clock;
}
#[macro_export] macro_rules! has_clock {
(|$self:ident:$Struct:ident$(<$($L:lifetime),*$($T:ident$(:$U:path)?),*>)?|$cb:expr) => {
impl $(<$($L),*$($T $(: $U)?),*>)? HasClock for $Struct $(<$($L),*$($T),*>)? {
fn clock (&$self) -> &Clock { &$cb }
fn clock_mut (&mut $self) -> &mut Clock { &mut $cb }
}
}
}