This enhancement introduces a Nursery Trait that unifies the functions related to introducing and and shaping new holons and refactoring CommitManager and StagingArea so they both provide implementations of Nursery.
Current State
The holons zome defines a CommitManager struct:
pub struct CommitManager {
pub staged_holons: Vec<Rc<RefCell<Holon>>>, // Contains all holons staged for commit
pub keyed_index: BTreeMap<MapString, usize>, // Allows lookup by key to staged holons for which keys are defined
}
- the dances zome defines a StagingArea struct:
pub struct StagingArea {
pub staged_holons:Vec, // Contains all holons staged for commit
index: BTreeMap<MapString, usize>, // Allows lookup by key to staged holons for which keys are defined
}
- Only a couple of the CommitManager's functions relate to _commit_, most are related to managing or operating on its `staged_holons`
- The StagingArea was originally introduced as a simple data structure that allowed the state of staged holons to be pinged back and forth between client and guest.
## Proposal
- [ ] Create a new nursery.rs file within the holons zome that includes:
- [ ] Nursery Trait
- [ ]
UNDER CONSTRUCTION
This enhancement introduces a Nursery Trait that unifies the functions related to introducing and and shaping new holons and refactoring CommitManager and StagingArea so they both provide implementations of Nursery.
Current State
pub struct StagingArea { pub staged_holons:Vec, // Contains all holons staged for commit
index: BTreeMap<MapString, usize>, // Allows lookup by key to staged holons for which keys are defined
}