omics_coordinate/system/base.rs
1//! The base coordinate system.
2
3use crate::system::System;
4
5////////////////////////////////////////////////////////////////////////////////////////
6// Assertions
7////////////////////////////////////////////////////////////////////////////////////////
8
9const _: () = {
10 use std::mem::size_of;
11
12 // This should never take up any space.
13 assert!(size_of::<Base>() == 0);
14};
15
16////////////////////////////////////////////////////////////////////////////////////////
17// Base coordinate system
18////////////////////////////////////////////////////////////////////////////////////////
19
20/// The base coordinate system.
21///
22/// This coordinate system is also known as the "1-based, fully-closed"
23/// coordinate system.
24#[derive(Copy, Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd)]
25pub struct Base;
26
27impl Base {
28 /// A static string representing the name of the base coordinate system.
29 pub const NAME: &str = "base coordinate system";
30}
31
32impl System for Base {}
33
34impl std::fmt::Display for Base {
35 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
36 write!(f, "{}", Self::NAME)
37 }
38}