Add comments to help explain Graphene concepts

This commit is contained in:
Keavon Chambers
2023-10-24 21:32:42 -07:00
parent ee08938bb0
commit bafde43145
5 changed files with 78 additions and 45 deletions

View File

@@ -2,6 +2,25 @@ use core::marker::PhantomData;
use crate::{Node, NodeMut};
// This is how we can generically define composition of two nodes.
// This is done generically as shown: <https://files.keavon.com/-/SurprisedGaseousAnhinga/capture.png>
// A concrete example: <https://files.keavon.com/-/ExcitableGoldRay/capture.png>
// And showing the direction of data flow: <https://files.keavon.com/-/SoreShimmeringElephantseal/capture.png>
/// ┌────────────────┐
/// T │ │ U
/// ───────────►│ Compose Node ├───────────►
/// │ │
/// └────┬───────────┤
/// ┌──────────┐ │ │
/// │ │ T -> V │ │
/// │ First ├─────────────►│ │
/// │ │ │ │
/// └──────────┘ │ │
/// ┌──────────┐ │ │
/// │ │ V -> U │ │
/// │ Second ├─────────────►│ │
/// │ │ └───────────┘
/// └──────────┘
#[derive(Clone, Copy)]
pub struct ComposeNode<First, Second, I> {
first: First,