Skip to content

Inconsistent snapshot return types #1851

Description

@ludfjig

snapshot() returns Result<Arc<Snapshot>>, but load() and checked_load() return Result<Snapshot>. Both from_snapshot() and restore() require Arc<Snapshot>, forcing callers to wrap loaded snapshots manually.

snapshot() needs shared ownership because the sandbox caches the snapshot while returning it to the caller. Loading creates a fresh value with no other owner, so returning Snapshot leaves ownership choices to the caller.

Potential fixes:

  • Return Arc<Snapshot> from both load methods.
  • Accept impl Into<Arc<Snapshot>> in from_snapshot() and restore() so either form works.
    *... something else

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions