[][src]Struct pakr_rawata::Device

pub struct Device(_);

Attached ATA device

Implementations

impl Device[src]

pub fn open<P>(dev: P) -> Result<Self> where
    P: AsRef<Path>, 
[src]

Open device pointed by a specific path.

DO NOT use partition references here (like /dev/sda1 on Linux or /dev/ada0p1 on FreeBSD). Use only raw disk references, like /dev/sda on Linux or /dev/ada0 on FreeBSD.

pub fn close(&mut self)[src]

Close opened device

pub fn read(&mut self, sector: u64, buffer: &mut [u8]) -> Result<()>[src]

Read sector(s) from disk.

Buffer size must be multiple of sector size. It bypasses all protections and caches/buffers.

pub fn write(&mut self, sector: u64, buffer: &[u8]) -> Result<()>[src]

Write sector(s) to disk.

Buffer size must be multiple of sector size. It bypasses all protections and caches/buffers.

pub fn info(&mut self) -> Result<IdentifyDeviceData>[src]

Get identification record from disk.

Auto Trait Implementations

impl RefUnwindSafe for Device

impl Send for Device

impl Sync for Device

impl Unpin for Device

impl UnwindSafe for Device

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.