Skip to content

[Rust][Errors] Map C failures to a focused Rust error type #236

Description

@utilForever

Parent: #137

Goal

Convert native status codes and thread-local diagnostics into structured Results.

Scope

  • Define stable variants for broad C error categories
  • Capture the diagnostic message at the failing call
  • Implement Display and Error

Non-goals

  • One error variant per function
  • Panicking on user input
  • Exposing thread-local pointers

Acceptance criteria

  • Public safe methods return Result for recoverable failures.
  • Messages survive subsequent native calls.
  • Unknown future codes remain representable.

Verification

Add tests for invalid handles through sys, invalid maps, invalid directions, buffers, snapshots, and unknown codes.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions