macroonz_compiler/support/
types.rs1use crate::bounded::NonEmpty;
3#[path = "type_guard.rs"]
4mod guard;
5pub const PATH_SEGMENT_LIMIT: usize = 8;
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
9pub struct SchemaId([u8; 32]);
10pub const EXPECTED_SCHEMA_ID: SchemaId = SchemaId::pinned([
12 185, 251, 251, 45, 168, 146, 85, 42, 248, 177, 196, 48, 117, 229, 207, 5, 84, 120, 104, 25,
13 150, 41, 202, 2, 243, 73, 31, 148, 241, 22, 122, 34,
14]);
15crate::roster! {
16 pub enum CrateFacing {
18 Declaring = "declaring",
20 Harness = "harness",
22 }
23}
24crate::roster! {
25 pub enum DeliveryForm {
27 Trials = "trials",
29 Benches = "benches",
31 }
32}
33#[must_use = "a declaration refusal names the exact seat the declaration did not fill"]
35#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
36pub enum DeclarationError {
37 EmptyNamespace,
39 EmptyStem,
41 SpellingNotAnIdentifier,
43 PathSegmentsAbsent,
45 PathSegmentsUnbounded,
47}
48#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
50pub struct WallName {
51 namespace: String,
52 stem: String,
53}
54#[derive(Debug, Clone, PartialEq, Eq, Hash)]
56pub struct BoundPath {
57 facing: CrateFacing,
58 segments: NonEmpty<String, PATH_SEGMENT_LIMIT>,
59}
60#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
62pub struct SupportName(String);
63pub use guard::{rendered_identifier, rendered_name};