diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a4a72..aa07fe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -No unreleased changes yet. +- Add `from_raw` and `into_raw` methods to `RestoreState`. ## [v1.3.0] - 2026-06-02 diff --git a/src/lib.rs b/src/lib.rs index 3c05de8..a94481c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -137,6 +137,16 @@ pub type RawRestoreState = RawRestoreStateInner; pub struct RestoreState(RawRestoreState); impl RestoreState { + /// Creates a restore state from its raw representation. + pub fn from_raw(raw_restore_state: RawRestoreState) -> Self { + Self(raw_restore_state) + } + + /// Converts this restore state into its raw representation. + pub fn into_raw(self) -> RawRestoreState { + self.0 + } + /// Create an invalid, dummy `RestoreState`. /// /// This can be useful to avoid `Option` when storing a `RestoreState` in a