[][src]Struct sunrise_fs::interface::storage::FileStorage

#[repr(transparent)]pub struct FileStorage<F: FileOperations>(F);

Wrapper around a FileOperations exposing a StorageDevice interface.

Implementations

impl<F: FileOperations> FileStorage<F>[src]

pub fn new(f: F) -> FileStorage<F>[src]

Creates a new StorageDevice from the given FileOperations.

Trait Implementations

impl<F: Debug + FileOperations> Debug for FileStorage<F>[src]

impl<F: FileOperations> IStorage for FileStorage<F>[src]

fn set_size(&mut self, new_size: u64) -> LibUserResult<()>[src]

Set the total size of the storage in bytes.

impl<F: FileOperations> StorageDevice for FileStorage<F>[src]

type Error = Error

Error type returned by this block device when an operation fails

fn read(&mut self, offset: u64, buf: &mut [u8]) -> LibUserResult<()>[src]

Read the data at the given offset in the storage into a given buffer.

fn write(&mut self, offset: u64, buf: &[u8]) -> LibUserResult<()>[src]

Write the data from the given buffer at the given offset in the storage.

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

Writes every dirty data to the storage.

Auto Trait Implementations

impl<F> RefUnwindSafe for FileStorage<F> where
    F: RefUnwindSafe

impl<F> Send for FileStorage<F>

impl<F> Sync for FileStorage<F>

impl<F> Unpin for FileStorage<F> where
    F: Unpin

impl<F> UnwindSafe for FileStorage<F> where
    F: UnwindSafe

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.