macroonz_compiler/support/
types.rs1use crate::bounded::NonEmpty;
3#[path = "type_guard.rs"]
4mod guard;
5pub const PATH_SEGMENT_LIMIT: usize = crate::token::RENDERED_PATH_SEGMENT_LIMIT;
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}
24#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
26pub(crate) enum DeclaringBinding {
27 Absent,
29 Required,
31}
32crate::roster! {
33 pub enum DeliveryForm {
35 Trials = "trials",
37 Benches = "benches",
39 }
40}
41#[must_use = "a declaration refusal names the exact seat the declaration did not fill"]
43#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
44pub enum DeclarationError {
45 EmptyNamespace,
47 EmptyStem,
49 SpellingNotAnIdentifier,
51 PathSegmentsAbsent,
53 PathSegmentsUnbounded,
55}
56#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
58pub struct WallName {
59 namespace: String,
60 stem: String,
61}
62#[derive(Debug, Clone, PartialEq, Eq, Hash)]
64pub struct BoundPath {
65 facing: CrateFacing,
66 segments: NonEmpty<String, PATH_SEGMENT_LIMIT>,
67}
68#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
70pub struct SupportName(String);
71pub use guard::{rendered_identifier, rendered_name};