Skip to main content

Mmc

Struct Mmc 

Source
pub struct Mmc { /* private fields */ }
Available on crate feature mmc only.
Expand description

An interface for SCSI MMC commands.

Implementations§

Source§

impl Mmc

Methods related to the GET CONFIGURATION command.

Source

pub fn features(&self) -> Result<Vec<MmcFeature>, MmcOperationError>

Get a list of MMC features supported by the device.

Returns None on error or if the device is unavailable.

Source§

impl Mmc

Routines based on MMC GET EVENT STATUS NOTIFICATION.

Source

pub fn supported_events(&self) -> Result<EventClass, MmcStatusError>

Get all the event classes supported by the device.

Source

pub fn is_tray_open(&self) -> Result<bool, MmcStatusError>

Is the device tray open.

If the device does not have a tray, this should still return false.

Source

pub fn operational_event_status( &self, ) -> Result<OperationalStatus, MmcStatusError>

Get operational change status from the device.

Source

pub fn power_status(&self) -> Result<PowerStatus, MmcStatusError>

Get power management status from the device.

Source

pub fn external_status(&self) -> Result<ExternalRequestStatus, MmcStatusError>

Get external request status from the device.

Source

pub fn media_status(&self) -> Result<MediaStatus, MmcStatusError>

Get media status from the device.

Source

pub fn multihost_status(&self) -> Result<MultiHostStatus, MmcStatusError>

Get multiple host event status from the device.

Source

pub fn busy_status(&self) -> Result<BusyStatus, MmcStatusError>

Get busy status from the device.

Source§

impl Mmc

Routines based on MMC INQUIRY.

Source

pub fn hardware_identifiers( &self, ) -> Result<HardwareIdentifiers, GetHardwareIdentifiersError>

Get the hardware identifiers (Product, Vendor and Revision).

Source§

impl Mmc

Routines based on MMC PREVENT ALLOW MEDIUM REMOVAL

Source

pub fn allow_media_removal(&self) -> Result<(), MmcMediaRemovalError>

Allow media removal.

Source

pub fn prevent_media_removal(&self) -> Result<(), MmcMediaRemovalError>

Prevent media removal.

Source§

impl Mmc

Routines based on READ CD.

Source

pub fn read_cd( &self, options: ReadCdOptions, sector: u32, count: u16, buf: &mut [u8], ) -> Result<(), MmcReadCdError>

Read disc using MMC READ CD.

The transfer size is dependent on the opted fields in the read options. See ReadCdOptions.

Source§

impl Mmc

Routines based on MMC READ DISC INFORMATION.

Source

pub fn is_disc_erasable(&self) -> Result<bool, MmcReadDiscInfoError>

Indicates that the media is of a writable kind (such as CD-RW, BD-RE, DVD+RW, etc) and the drive is capable of writing to the media.

Source§

impl Mmc

Routines based on MMC READ SUB-CHANNEL.

Source

pub fn audio_status(&self) -> Result<MmcAudioStatus, MmcAudioStatusError>

Get the status of audio play operations.

Source

pub fn media_catalog_number(&self) -> Result<Option<String>, MmcSubchannelError>

Get the Media Catalog Number (UPC/bar code), if found.

Source

pub fn isrc( &self, track_number: TrackNumber, ) -> Result<Option<String>, MmcSubchannelError>

Get the International Standard Recording Code (ISRC) of given track number.

Source

pub fn cd_current_position( &self, ) -> Result<CdCurrentPosition, MmcSubchannelError>

Get the current position of the disc in time units.

Source§

impl Mmc

Routines based on MMC READ TOC/PMA/ATIP.

Source

pub fn cd_text(&self) -> Result<Vec<u8>, MmcTocError>

Get the CD-TEXT from the RW sub-channel of the media.

Source

pub fn cd_type(&self) -> Result<CdType, MmcTocError>

Get the CD type of the media.

Source

pub fn last_sector(&self) -> Result<u32, MmcTocError>

Get the last Logical Sector Number (LSN) of the disc

Source§

impl Mmc

Routines based on MMC SET CD SPEED.

Source

pub fn set_cd_speed( &self, rotation_mode: RotationMode, read_speed: u16, write_speed: u16, ) -> Result<(), MmcSetCdSpeedError>

Set the read and write speeds of the drive, in kilo bytes per second.

Source§

impl Mmc

Routines based on MMC START STOP UNIT.

Source

pub fn eject(&self) -> Result<(), MmcEjectError>

Eject the media, if permitted.

This might require a prior allow eject operation.

Source

pub fn close_tray(&self) -> Result<(), MmcCloseTrayError>

Close the tray.

Source

pub fn set_power_state( &self, state: PowerCondition, ) -> Result<(), MmcSetPowerStateError>

Set power state.

Source§

impl Mmc

Routines on MMC TEST UNIT READY.

Source

pub fn test_unit_ready(&self) -> Result<(), MmcTestUnitReadyError>

Returns Ok if the device is ready.

Source§

impl Mmc

Source

pub fn new() -> Result<Mmc, MmcNotFoundError>

Use a default device.

§Errors

If an MMC capable device could not be found.

Source

pub fn with_device(device: PathBuf) -> Result<Mmc, WithDeviceError>

Use the provided device.

§Errors

If there are no devices with MMC connected, or the device could not be opened.

Source

pub fn sense_data(&self) -> Option<MmcSenseData>

Returns the current sense data from the device.

Auto Trait Implementations§

§

impl !Send for Mmc

§

impl !Sync for Mmc

§

impl Freeze for Mmc

§

impl RefUnwindSafe for Mmc

§

impl Unpin for Mmc

§

impl UnsafeUnpin for Mmc

§

impl UnwindSafe for Mmc

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more