mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 23:19:29 +02:00
25 lines
477 B
Rust
25 lines
477 B
Rust
use super::markers::{BlockDevice, Origin};
|
|
use std::marker::PhantomData;
|
|
use std::path::{Path, PathBuf};
|
|
|
|
#[derive(Debug)]
|
|
pub struct Partition<'a> {
|
|
path: PathBuf,
|
|
origin: PhantomData<&'a dyn Origin>,
|
|
}
|
|
|
|
impl<'a> Partition<'a> {
|
|
pub fn new<T: Origin + 'a>(path: PathBuf) -> Self {
|
|
Self {
|
|
path,
|
|
origin: PhantomData,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl<'a> BlockDevice for Partition<'a> {
|
|
fn path(&self) -> &Path {
|
|
&self.path
|
|
}
|
|
}
|