mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 20:56:43 +01:00
wip: down to 25 errors woo
This commit is contained in:
parent
89288f2920
commit
6ce83fb27a
25 changed files with 688 additions and 620 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use crate::*;
|
||||
|
||||
mod clock_api; pub use self::clock_api::*;
|
||||
mod clock_model; pub use self::clock_model::*;
|
||||
mod clock_view; pub use self::clock_view::*;
|
||||
|
|
@ -7,11 +9,11 @@ pub trait HasClock: Send + Sync {
|
|||
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 }
|
||||
}
|
||||
impl<T: Has<Clock>> HasClock for T {
|
||||
fn clock (&self) -> &Clock {
|
||||
self.get()
|
||||
}
|
||||
fn clock_mut (&mut self) -> &mut Clock {
|
||||
self.get_mut()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue