pub enum ZoneShape {
Rectangle {
height: f64,
width: f64,
},
Polygon {
points: Vec<Vec2>,
},
}Expand description
A zone footprint, expressed as an axis-aligned rectangle or an explicit polygon. Vertices/extent are relative to the owning element’s position.
JSON schema
{
"description": "A zone footprint, expressed as an axis-aligned rectangle or an explicit polygon. Vertices/extent are relative to the owning element's position.",
"oneOf": [
{
"type": "object",
"required": [
"height",
"type",
"width"
],
"properties": {
"height": {
"type": "number",
"exclusiveMinimum": 0.0
},
"type": {
"const": "rectangle"
},
"width": {
"type": "number",
"exclusiveMinimum": 0.0
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"points",
"type"
],
"properties": {
"points": {
"type": "array",
"items": {
"$ref": "#/$defs/vec2"
},
"minItems": 3
},
"type": {
"const": "polygon"
}
},
"additionalProperties": false
}
]
}Variants§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ZoneShape
impl<'de> Deserialize<'de> for ZoneShape
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ZoneShape
Auto Trait Implementations§
impl Freeze for ZoneShape
impl RefUnwindSafe for ZoneShape
impl Send for ZoneShape
impl Sync for ZoneShape
impl Unpin for ZoneShape
impl UnsafeUnpin for ZoneShape
impl UnwindSafe for ZoneShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more