Skip to content

Commit

Permalink
Update documentation of Surface
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Mar 13, 2024
1 parent f7d98b6 commit 5b66aa7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/fj-core/src/objects/kinds/surface.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
/// A two-dimensional shape
///
///
/// ## Equality
///
/// `Surface` contains no data and exists purely to be referenced via a
/// `Handle`, where `Handle::id` can be used to compare different instances of
/// it.
///
/// If `Surface` had `Eq`/`PartialEq` implementations, it containing no data
/// would mean that all instances of `Surface` would be considered equal. This
/// would be very error-prone.
///
/// If you need to reference a `Surface` from a struct that needs to derive
/// `Eq`/`Ord`/..., you can use `HandleWrapper<Vertex>` to do that. It will
/// use `Handle::id` to provide those `Eq`/`Ord`/... implementations.
#[derive(Clone, Copy, Debug, Default, Hash)]
pub struct Surface {}

Expand Down

0 comments on commit 5b66aa7

Please sign in to comment.