summaryrefslogtreecommitdiff
path: root/examples/02-sum/output/rust/src/shapes.rs
blob: 31c3db96d05f445edcebfc875dc3e22e55d6b30d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Generated by hobgoblin.

/// A 2D shape.
pub enum Shape {
    Rectangle(crate::shapes::Rectangle),
    Triangle(crate::shapes::Triangle),
}

impl Shape {
    pub fn rectangle(value: crate::shapes::Rectangle) -> Self {
        Self::Rectangle(value)
    }

    pub fn triangle(value: crate::shapes::Triangle) -> Self {
        Self::Triangle(value)
    }
}

pub struct Rectangle {
    pub width: ::core::primitive::i32,
    pub height: ::core::primitive::i32,
}

pub struct Triangle {
    pub width: ::core::primitive::i32,
    pub height: ::core::primitive::i32,
}