Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enhance Bound Enum with Utility Methods and Refactor Storable T…
…rait (#142) ### Description: This PR introduces utility methods to the `Bound` enum, enhancing its functionality and usability. These methods are used to refactor the `Storable` trait, making it cleaner and more maintainable. #### Use-Case: I am developing a library aimed at simplifying the use of stable memory structures. For example, consider a `TaskTimerEntry` struct defined as: ```rust pub struct TaskTimerEntry<T> { pub time: NanoTimeStamp, pub task: T, } ``` To make this struct bounded, I can now easily specify: ```rust const BOUND: Bound = Bound::Bounded { is_fixed_size: false, max_size: 8 + T::BOUND.max_size(), }; ``` #### Key Changes: Introduced `max_size` and `is_fixed_size` methods to `Bound` enum. #### Impact on `Storable` Trait: The utility methods have been integrated into the `Storable` trait, enhancing its readability and maintainability without altering its core functionality. #### Types of Changes: - [x] New feature (non-breaking change which adds functionality) - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation Update (if none of the other choices apply)
- Loading branch information