Skip to main content

OpenVolume

Enum OpenVolume 

Source
#[non_exhaustive]
pub enum OpenVolume<'a, S>
where S: Seek,
{ Fat(FatVolume<Borrowed<'a, S>>), }
Expand description

An asynchronously opened block filesystem with concrete-format access.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Fat(FatVolume<Borrowed<'a, S>>)

An opened FAT12, FAT16, or FAT32 filesystem.

Implementations§

Source§

impl<'a, S> OpenVolume<'a, S>
where S: Read + Seek<Error = <S as Read>::Error>,

Source

pub async fn open(source: &'a mut S, logical_block_size: u32) -> Result<Self>

Asynchronously detects and opens a filesystem at the start of source.

Partitioned disks must first be narrowed to a partition view.

Source

pub async fn open_detected( source: &'a mut S, detected: FatVariant, ) -> Result<Self>

Asynchronously opens a previously detected FAT variant.

Source

pub fn format(&self) -> FatVariant

Returns the concrete FAT variant of the opened filesystem.

Source

pub fn as_fat(&self) -> Option<&FatVolume<Borrowed<'a, S>>>

Borrows the opened FAT filesystem.

Source

pub fn as_fat_mut(&mut self) -> Option<&mut FatVolume<Borrowed<'a, S>>>

Mutably borrows the opened FAT filesystem.

Source

pub fn into_fat(self) -> Result<FatVolume<Borrowed<'a, S>>, Self>

Extracts the FAT filesystem, returning self if its format differs.

Source

pub fn into_inner(self) -> &'a mut S

Closes the filesystem and returns the borrowed source.

Auto Trait Implementations§

§

impl<'a, S> !Freeze for OpenVolume<'a, S>

§

impl<'a, S> !RefUnwindSafe for OpenVolume<'a, S>

§

impl<'a, S> !Send for OpenVolume<'a, S>

§

impl<'a, S> !Sync for OpenVolume<'a, S>

§

impl<'a, S> !UnwindSafe for OpenVolume<'a, S>

§

impl<'a, S> Unpin for OpenVolume<'a, S>

§

impl<'a, S> UnsafeUnpin for OpenVolume<'a, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybePod for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.