[][src]Struct sunrise_fs::detail::driver::DriverManager

pub struct DriverManager {
    registry: Vec<Box<dyn FileSystemDriver>>,
    drives: HashMap<DiskId, Arc<Mutex<Box<dyn IStorage<Error = Error>>>>>,
    partitions: HashMap<DiskId, HashMap<PartitionId, Weak<Mutex<Box<dyn FileSystemOperations>>>>>,
    ahci_interface: AhciInterfaceProxy,
}

Instance handling drivers registration and usage.

Fields

registry: Vec<Box<dyn FileSystemDriver>>

The registry of the drivers availaible.

drives: HashMap<DiskId, Arc<Mutex<Box<dyn IStorage<Error = Error>>>>>

The drives actually opened.

partitions: HashMap<DiskId, HashMap<PartitionId, Weak<Mutex<Box<dyn FileSystemOperations>>>>>

The partitions opened in drives.

ahci_interface: AhciInterfaceProxy

AHCI IPC interface.

Implementations

impl DriverManager[src]

pub fn register_driver(&mut self, driver: Box<dyn FileSystemDriver>)[src]

Register a new driver

pub fn add_opened_drive(
    &mut self,
    disk_id: DiskId,
    drive: Arc<Mutex<Box<dyn IStorage<Error = Error>>>>
)
[src]

Add a new drive to the open hashmap.

pub fn init_drives(&mut self) -> LibUserResult<()>[src]

Do the disk init using AHCI

pub fn open_disk_storage(
    &mut self,
    disk_id: DiskId
) -> LibUserResult<Arc<Mutex<Box<dyn IStorage<Error = Error>>>>>
[src]

Open a AHCI disk as a IStorage.

pub fn get_disks_count(&mut self) -> u32[src]

Get the count of disks availaible.

pub fn construct_filesystem_from_disk_partition(
    &mut self,
    disk_id: DiskId,
    partition_id: PartitionId,
    storage: PartitionStorage
) -> LibUserResult<Arc<Mutex<Box<dyn FileSystemOperations>>>>
[src]

Open an instance of a filesystem.

pub fn format_disk_partition(
    &self,
    storage: PartitionStorage,
    filesytem_type: FileSystemType
) -> LibUserResult<()>
[src]

Format a partition storage to a given filesystem.

Trait Implementations

impl Default for DriverManager[src]

Auto Trait Implementations

impl !RefUnwindSafe for DriverManager

impl Send for DriverManager

impl !Sync for DriverManager

impl Unpin for DriverManager

impl !UnwindSafe for DriverManager

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.