From b4e6e0717ddea6016cdbf3745b80d31b3020d468 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 15 Feb 2024 12:17:08 +0100 Subject: [PATCH] Update documentation of `layers` --- crates/fj-core/src/layers/layer.rs | 4 ++-- crates/fj-core/src/layers/layers.rs | 2 +- crates/fj-core/src/layers/objects.rs | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/layers/layer.rs b/crates/fj-core/src/layers/layer.rs index edbdcc48b..4f4148a9a 100644 --- a/crates/fj-core/src/layers/layer.rs +++ b/crates/fj-core/src/layers/layer.rs @@ -80,8 +80,8 @@ pub trait Command { pub trait Event { /// Evolve the provided state /// - /// This is the only method that gets mutable access to the state, making - /// sure that all changes to the state are captured as events. + /// This is the only method that [`Layer`] gives mutable access to the + /// state, making sure that all changes to the state are captured as events. /// /// Implementations of this method are supposed to be relatively dumb. Any /// decisions that go into updating the state should be made in diff --git a/crates/fj-core/src/layers/layers.rs b/crates/fj-core/src/layers/layers.rs index 2682537a8..200fd4529 100644 --- a/crates/fj-core/src/layers/layers.rs +++ b/crates/fj-core/src/layers/layers.rs @@ -21,7 +21,7 @@ use super::Layer; /// That can be changed, once necessary. #[derive(Default)] pub struct Layers { - /// The objects layers + /// The objects layer /// /// Manages the stores of topological and geometric objects that make up /// shapes. diff --git a/crates/fj-core/src/layers/objects.rs b/crates/fj-core/src/layers/objects.rs index 121d60dc2..b5cff0ea2 100644 --- a/crates/fj-core/src/layers/objects.rs +++ b/crates/fj-core/src/layers/objects.rs @@ -8,7 +8,9 @@ use crate::{ use super::{Command, Event, Layer}; impl Layer { - /// Insert and object into the stores + /// Insert an object into the stores + /// + /// Passes any events produced to the validation layer. pub fn insert( &mut self, object: AnyObject, @@ -25,7 +27,8 @@ impl Layer { /// Insert an object into the stores /// -/// Event produced by `Layer`. +/// This struct serves as both event and command for `Layer`, as well +/// as a command for `Layer`. #[derive(Clone, Debug)] pub struct InsertObject { /// The object to insert