Skip to main content

Msd

Struct Msd 

Source
pub struct Msd { /* private fields */ }
Expand description

USB Mass Storage Device (MSD) function.

Implementations§

Source§

impl Msd

Source

pub fn new(file: impl AsRef<Path>) -> Result<(Msd, Handle)>

Creates a new USB Mass Storage Device (MSD) with the specified backing file.

Source

pub fn builder() -> MsdBuilder

Creates a new USB Mass Storage Device (MSD) builder.

Source

pub fn status(&self) -> Status

Access to registration status.

Source

pub fn force_eject(&self, lun: usize) -> Result<()>

Forcibly detach the backing file from the LUN, regardless of whether the host has allowed it.

Source

pub fn set_file<P: AsRef<Path>>( &self, lun: usize, file: Option<P>, ) -> Result<()>

Set the path to the backing file for the LUN.

Trait Implementations§

Source§

impl Debug for Msd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Msd

§

impl RefUnwindSafe for Msd

§

impl Send for Msd

§

impl Sync for Msd

§

impl Unpin for Msd

§

impl UnsafeUnpin for Msd

§

impl UnwindSafe for Msd

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<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, 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.