pub struct AtaDrive { /* private fields */ }
Expand description
A single ATA drive, either a master or a slave, which sits on one of two buses within a larger IDE controller.
Implementations§
source§impl AtaDrive
impl AtaDrive
sourcepub fn read_pio(
&mut self,
buffer: &mut [u8],
offset_in_sectors: usize
) -> Result<usize, &'static str>
pub fn read_pio( &mut self, buffer: &mut [u8], offset_in_sectors: usize ) -> Result<usize, &'static str>
Reads data from this drive starting at the given offset_in_sectors
into the provided buffer
.
The length of the given buffer
determines the number of bytes to be written.
As content is read from the drive at sector granularity, the buffer length must be a multiple of the sector size (512 bytes), and the offset is specified in number of sectors (not number of bytes) from the beginning of the drive.
Returns the number of sectors (not bytes) that were successfully written to the drive.
Note
This is slow, as it uses blocking port I/O instead of DMA.
sourcepub fn write_pio(
&mut self,
buffer: &[u8],
offset_in_sectors: usize
) -> Result<usize, &'static str>
pub fn write_pio( &mut self, buffer: &[u8], offset_in_sectors: usize ) -> Result<usize, &'static str>
Writes data from the provided buffer
to this drive, starting at the given offset_in_sectors
into the drive.
The length of the given buffer
determines the number of bytes to be written.
As content is written to the drive at sector granularity, the buffer length must be a multiple of the sector size (512 bytes), and the offset is specified in number of sectors (not number of bytes) from the beginning of the drive.
Returns the number of sectors (not bytes) that were successfully written to the drive.
Note
This is slow, as it uses blocking port I/O instead of DMA.
Trait Implementations§
source§impl BlockIo for AtaDrive
impl BlockIo for AtaDrive
source§fn block_size(&self) -> usize
fn block_size(&self) -> usize
source§impl BlockWriter for AtaDrive
impl BlockWriter for AtaDrive
Auto Trait Implementations§
impl !RefUnwindSafe for AtaDrive
impl Send for AtaDrive
impl Sync for AtaDrive
impl Unpin for AtaDrive
impl !UnwindSafe for AtaDrive
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.