Skip to content

feat: add forwarding impl PageTableFrameMapping for &P#556

Merged
Freax13 merged 1 commit into
rust-osdev:masterfrom
mkroening:forward-page_table_frame_mapping
Jul 6, 2025
Merged

feat: add forwarding impl PageTableFrameMapping for &P#556
Freax13 merged 1 commit into
rust-osdev:masterfrom
mkroening:forward-page_table_frame_mapping

Conversation

@mkroening

Copy link
Copy Markdown
Member

Since all methods of PageTableFrameMapping take self by reference, we can implement PageTableFrameMapping for all &P where P: PageTableMapping.

This is useful whenever we need a P: PageTableMapping by value, but we only have a &P, for example from MappedPageTable::page_table_frame_mapping(&self) -> &P.

@Freax13 Freax13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

This seems reasonable. I don't expect us to add methods that take a mutable reference in the future.

@Freax13 Freax13 merged commit 72954bb into rust-osdev:master Jul 6, 2025
8 of 12 checks passed
@mkroening mkroening deleted the forward-page_table_frame_mapping branch July 6, 2025 16:57
@mkroening mkroening restored the forward-page_table_frame_mapping branch July 6, 2025 16:57
@Freax13 Freax13 mentioned this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants