pub struct SpatialContract {
pub entry: String,
pub spaces: BTreeMap<String, ContractSpace>,
pub no_body: BTreeMap<String, ContractNoBody>,
pub edges: Vec<ContractEdge>,
pub faces: Vec<ContractFace>,
pub no_body_majority_ack: Option<String>,
}Expand description
A piece’s declared spaces, out-of-walk regions and edges, already resolved: every box is a local cell range of these exact bytes.
Resolved rather than parametric on purpose. A grammar program’s declarations
are scope-bound and mean different boxes at different parameters, so the only
contract that can describe this .nbt is the one its own expansion
produced. That is also what lets a hand-built piece carry the same block: it
has no parameters to resolve, so the two routes write the same shape and one
reader serves both.
Fields§
§entry: StringThe space a body enters at.
spaces: BTreeMap<String, ContractSpace>Named spaces.
no_body: BTreeMap<String, ContractNoBody>Named standable-but-out-of-walk regions.
edges: Vec<ContractEdge>The graph, in declaration order.
faces: Vec<ContractFace>The piece’s face contract: every exterior edge, as the side of the
piece it is on and the opening it leaves there.
Derived from the edges and the blocks at export time and written out, so
that assembly can ask whether two pieces fit without opening either
.nbt. It is the thing an exterior edge IS from the outside: an edge
with no cells is a claim nothing can mate with, and one whose opening
does not answer its neighbour’s is two pieces that were each approved
alone and do not assemble.
no_body_majority_ack: Option<String>The author’s acknowledgement that this piece is mostly out-of-walk.
Trait Implementations§
Source§impl Clone for SpatialContract
impl Clone for SpatialContract
Source§fn clone(&self) -> SpatialContract
fn clone(&self) -> SpatialContract
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpatialContract
impl Debug for SpatialContract
Source§impl<'de> Deserialize<'de> for SpatialContract
impl<'de> Deserialize<'de> for SpatialContract
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SpatialContract
impl JsonSchema for SpatialContract
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more