rust-osdev / rust-osdev/x86_64

Impl `TryFrom`, `From`, and `Into` for `VirtAddr`

Open
#268 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
940
Forks
157
Avg merge
1d 10h
Merged PRs (30d)
3

Description

Hello,

I was wondering if it would be useful to Implement TryFrom, From, and Into for VirtAddr (and maybe other some types as well). I noticed that VirtAddr type specifically has a to_u64. Reading the docs though it seems like the Into trait might be a more idiomatic way to do this.

Another one that might make sense is the TryFrom for u64 and From trait for u32, u16, u8 (the latter would automatically create an Into according to the docs).

If this seems like a worthwhile feature I'd be happy to make pull request.

Fantastic crate btw!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating VirtAddr and its existing to_u64 method, then review the Rust From, Into, and TryFrom documentation to define the proposed conversion scope. Done means the selected conversions are implemented consistently for VirtAddr and any additional types agreed upon, with behavior covered by the project's tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.