1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use alloc::boxed::Box;
use sunrise_libuser::fs::FileSystemType;
use sunrise_libuser::error::Error;
use crate::LibUserResult;
use super::filesystem::FileSystemOperations;
use storage_device::StorageDevice;
pub trait FileSystemDriver: Send {
fn construct(&self, storage: Box<dyn StorageDevice<Error = Error> + Send>) -> LibUserResult<Box<dyn FileSystemOperations>>;
fn probe(&self, storage: &mut (dyn StorageDevice<Error = Error> + Send)) -> Option<FileSystemType>;
fn is_supported(&self, filesytem_type: FileSystemType) -> bool;
fn format(&self, storage: Box<dyn StorageDevice<Error = Error> + Send>, filesytem_type: FileSystemType) -> LibUserResult<()>;
}