Skip to content

Commit

Permalink
Refactor StateManagement trait to add iter method
Browse files Browse the repository at this point in the history
  • Loading branch information
b3hr4d committed Sep 24, 2024
1 parent a8ec590 commit e09d1b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/memory/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ pub trait StateManagement {
/// Get a readable state for an item
fn read(id: Self::Id) -> Self::ReadState;

/// Iterate over all items in the state
fn iter<F, R>(f: F) -> Vec<R>
where
F: FnMut(&Self::Id, &Self::Item) -> R;

/// Get views of all items in the state
fn views() -> Vec<Self::View>;

Expand Down

0 comments on commit e09d1b9

Please sign in to comment.