mirror of
https://github.com/PacktPublishing/Rust-High-Performance.git
synced 2026-01-25 02:34:19 +09:00
31 lines
467 B
Rust
31 lines
467 B
Rust
pub trait PageTable {}
|
|
|
|
pub enum P4 {}
|
|
pub enum P3 {}
|
|
pub enum P2 {}
|
|
pub enum P1 {}
|
|
|
|
impl PageTable for P4 {}
|
|
impl PageTable for P3 {}
|
|
impl PageTable for P2 {}
|
|
impl PageTable for P1 {}
|
|
|
|
pub trait HighTable: PageTable {
|
|
type NextTable: PageTable;
|
|
}
|
|
|
|
impl HighTable for P4 {
|
|
type NextTable = P3;
|
|
}
|
|
|
|
impl HighTable for P3 {
|
|
type NextTable = P2;
|
|
}
|
|
|
|
impl HighTable for P2 {
|
|
type NextTable = P1;
|
|
}
|
|
|
|
// Dummy main function to check compilation.
|
|
fn main() {}
|