Inconsistent snapshot return types

Offen
#1,851 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Refactoring
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
backend

Rechercherichtung

Look at the snapshot(), load(), and checked_load() methods in the codebase, likely in a file related to snapshot management or the sandbox. Examine from_snapshot() and restore() to see their parameter types. The task is to align return types or parameter acceptance, so start by understanding the ownership flow and the Arc<Snapshot> usage. Run existing tests to ensure changes don't break functionality.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

S-needs-triage

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
Vorherrschende Sprache
Rust
Sterne
4.8k
Forks
222
Ø Merge
1 T. 16 Std.
Gemergte PRs (30 T.)
60

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus hyperlight-dev/hyperlight

Alle Issues in hyperlight-dev/hyperlight

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.