tabula rasa

This commit is contained in:
🪞👃🪞 2025-03-02 14:31:04 +02:00
commit 47b3413d7d
76 changed files with 7000 additions and 0 deletions

31
output/src/coordinate.rs Normal file
View file

@ -0,0 +1,31 @@
use std::fmt::{Debug, Display};
use std::ops::{Add, Sub, Mul, Div};
impl Coordinate for u16 {
#[inline] fn plus (self, other: Self) -> Self {
self.saturating_add(other)
}
}
/// A linear coordinate.
pub trait Coordinate: Send + Sync + Copy
+ Add<Self, Output=Self>
+ Sub<Self, Output=Self>
+ Mul<Self, Output=Self>
+ Div<Self, Output=Self>
+ Ord + PartialEq + Eq
+ Debug + Display + Default
+ From<u16> + Into<u16>
+ Into<usize>
+ Into<f64>
{
#[inline] fn zero () -> Self { 0.into() }
#[inline] fn minus (self, other: Self) -> Self {
if self >= other {
self - other
} else {
0.into()
}
}
fn plus (self, other: Self) -> Self;
}