pub struct Mmc { /* private fields */ }mmc only.Expand description
An interface for SCSI MMC commands.
Implementations§
Source§impl Mmc
Methods related to the GET CONFIGURATION command.
impl Mmc
Methods related to the GET CONFIGURATION command.
Sourcepub fn features(&self) -> Result<Vec<MmcFeature>, MmcOperationError>
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.
impl Mmc
Routines based on MMC GET EVENT STATUS NOTIFICATION.
Sourcepub fn supported_events(&self) -> Result<EventClass, MmcStatusError>
pub fn supported_events(&self) -> Result<EventClass, MmcStatusError>
Get all the event classes supported by the device.
Sourcepub fn is_tray_open(&self) -> Result<bool, MmcStatusError>
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.
Sourcepub fn operational_event_status(
&self,
) -> Result<OperationalStatus, MmcStatusError>
pub fn operational_event_status( &self, ) -> Result<OperationalStatus, MmcStatusError>
Get operational change status from the device.
Sourcepub fn power_status(&self) -> Result<PowerStatus, MmcStatusError>
pub fn power_status(&self) -> Result<PowerStatus, MmcStatusError>
Get power management status from the device.
Sourcepub fn external_status(&self) -> Result<ExternalRequestStatus, MmcStatusError>
pub fn external_status(&self) -> Result<ExternalRequestStatus, MmcStatusError>
Get external request status from the device.
Sourcepub fn media_status(&self) -> Result<MediaStatus, MmcStatusError>
pub fn media_status(&self) -> Result<MediaStatus, MmcStatusError>
Get media status from the device.
Sourcepub fn multihost_status(&self) -> Result<MultiHostStatus, MmcStatusError>
pub fn multihost_status(&self) -> Result<MultiHostStatus, MmcStatusError>
Get multiple host event status from the device.
Sourcepub fn busy_status(&self) -> Result<BusyStatus, MmcStatusError>
pub fn busy_status(&self) -> Result<BusyStatus, MmcStatusError>
Get busy status from the device.
Source§impl Mmc
Routines based on MMC INQUIRY.
impl Mmc
Routines based on MMC INQUIRY.
Sourcepub fn hardware_identifiers(
&self,
) -> Result<HardwareIdentifiers, GetHardwareIdentifiersError>
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
impl Mmc
Routines based on MMC PREVENT ALLOW MEDIUM REMOVAL
Sourcepub fn allow_media_removal(&self) -> Result<(), MmcMediaRemovalError>
pub fn allow_media_removal(&self) -> Result<(), MmcMediaRemovalError>
Allow media removal.
Sourcepub fn prevent_media_removal(&self) -> Result<(), MmcMediaRemovalError>
pub fn prevent_media_removal(&self) -> Result<(), MmcMediaRemovalError>
Prevent media removal.
Source§impl Mmc
Routines based on READ CD.
impl Mmc
Routines based on READ CD.
Sourcepub fn read_cd(
&self,
options: ReadCdOptions,
sector: u32,
count: u16,
buf: &mut [u8],
) -> Result<(), MmcReadCdError>
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.
impl Mmc
Routines based on MMC READ DISC INFORMATION.
Sourcepub fn is_disc_erasable(&self) -> Result<bool, MmcReadDiscInfoError>
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.
impl Mmc
Routines based on MMC READ SUB-CHANNEL.
Sourcepub fn audio_status(&self) -> Result<MmcAudioStatus, MmcAudioStatusError>
pub fn audio_status(&self) -> Result<MmcAudioStatus, MmcAudioStatusError>
Get the status of audio play operations.
Sourcepub fn media_catalog_number(&self) -> Result<Option<String>, MmcSubchannelError>
pub fn media_catalog_number(&self) -> Result<Option<String>, MmcSubchannelError>
Get the Media Catalog Number (UPC/bar code), if found.
Sourcepub fn isrc(
&self,
track_number: TrackNumber,
) -> Result<Option<String>, MmcSubchannelError>
pub fn isrc( &self, track_number: TrackNumber, ) -> Result<Option<String>, MmcSubchannelError>
Get the International Standard Recording Code (ISRC) of given track number.
Sourcepub fn cd_current_position(
&self,
) -> Result<CdCurrentPosition, MmcSubchannelError>
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.
impl Mmc
Routines based on MMC READ TOC/PMA/ATIP.
Sourcepub fn cd_text(&self) -> Result<Vec<u8>, MmcTocError>
pub fn cd_text(&self) -> Result<Vec<u8>, MmcTocError>
Get the CD-TEXT from the RW sub-channel of the media.
Sourcepub fn cd_type(&self) -> Result<CdType, MmcTocError>
pub fn cd_type(&self) -> Result<CdType, MmcTocError>
Get the CD type of the media.
Sourcepub fn last_sector(&self) -> Result<u32, MmcTocError>
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.
impl Mmc
Routines based on MMC SET CD SPEED.
Sourcepub fn set_cd_speed(
&self,
rotation_mode: RotationMode,
read_speed: u16,
write_speed: u16,
) -> Result<(), MmcSetCdSpeedError>
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.
impl Mmc
Routines based on MMC START STOP UNIT.
Sourcepub fn eject(&self) -> Result<(), MmcEjectError>
pub fn eject(&self) -> Result<(), MmcEjectError>
Eject the media, if permitted.
This might require a prior allow eject operation.
Sourcepub fn close_tray(&self) -> Result<(), MmcCloseTrayError>
pub fn close_tray(&self) -> Result<(), MmcCloseTrayError>
Close the tray.
Sourcepub fn set_power_state(
&self,
state: PowerCondition,
) -> Result<(), MmcSetPowerStateError>
pub fn set_power_state( &self, state: PowerCondition, ) -> Result<(), MmcSetPowerStateError>
Set power state.
Source§impl Mmc
Routines on MMC TEST UNIT READY.
impl Mmc
Routines on MMC TEST UNIT READY.
Sourcepub fn test_unit_ready(&self) -> Result<(), MmcTestUnitReadyError>
pub fn test_unit_ready(&self) -> Result<(), MmcTestUnitReadyError>
Returns Ok if the device is ready.
Source§impl Mmc
impl Mmc
Sourcepub fn new() -> Result<Mmc, MmcNotFoundError>
pub fn new() -> Result<Mmc, MmcNotFoundError>
Sourcepub fn with_device(device: PathBuf) -> Result<Mmc, WithDeviceError>
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.
Sourcepub fn sense_data(&self) -> Option<MmcSenseData>
pub fn sense_data(&self) -> Option<MmcSenseData>
Returns the current sense data from the device.