Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading