fj_core/objects/kinds/surface.rs
1/// A two-dimensional shape
2///
3///
4/// ## Equality
5///
6/// `Surface` contains no data and exists purely to be referenced via a
7/// `Handle`, where `Handle::id` can be used to compare different instances of
8/// it.
9///
10/// If `Surface` had `Eq`/`PartialEq` implementations, it containing no data
11/// would mean that all instances of `Surface` would be considered equal. This
12/// would be very error-prone.
13///
14/// If you need to reference a `Surface` from a struct that needs to derive
15/// `Eq`/`Ord`/..., you can use `HandleWrapper<Vertex>` to do that. It will
16/// use `Handle::id` to provide those `Eq`/`Ord`/... implementations.
17#[derive(Clone, Copy, Debug, Default, Hash)]
18pub struct Surface {}
19
20impl Surface {
21 /// Construct an instance of `Surface`
22 pub fn new() -> Self {
23 Self::default()
24 }
25}