ratio_schema/lib.rs
1#![doc = include_str!("../README.md")]
2
3// ## License
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
6// If a copy of the MPL was not distributed with this file,
7// You can obtain one at <https://mozilla.org/MPL/2.0/>.
8//
9// **Code examples both in the docstrings and rendered documentation are free to use.**
10
11pub mod v1;
12
13/// Schema versions for the Canopy web application.
14#[derive(Copy, Clone, Debug, Default, PartialEq)]
15pub enum Version {
16 #[default]
17 V1,
18}
19
20#[cfg(feature = "schema")]
21impl Version {
22 /// Compile this schema.
23 pub fn compile(&self) -> schemars::Schema {
24 match self {
25 Self::V1 => schemars::schema_for!(v1::V1),
26 }
27 }
28}