Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

DriveModel

Struct DriveModel 

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

A drive: where the head is, how long a read takes, how long a seek takes.

Implementations§

Source§

impl DriveModel

Source

pub fn double_speed() -> Self

Double speed, nominal seeks, the measured table, clamped beyond 512 sectors, instant abort.

Source

pub fn single_speed() -> Self

The same at single speed. The seek table was measured at double speed and is kept as is (an assumption).

Source

pub fn with_variance(self, variance: Variance) -> Self

Choose how seek time varies between runs.

Source

pub fn with_far_seek_millis(self, millis: u32) -> Self

Seek time for any distance beyond the measured 512 sectors. Unmeasured: the default clamps to the 512-sector value.

Source

pub fn with_abort_micros(self, micros: u32) -> Self

Time a cancelled read takes to stop (default 0: unmeasured).

Source

pub fn abort_micros(&self) -> u32

Time a cancelled read takes to stop.

Source

pub fn micros_per_sector(&self) -> u32

Microseconds to read one sector.

Source

pub fn head(&self) -> Option<u32>

The sector under the head, when known.

Source

pub fn lose_head(&mut self)

Forget the head position (after an abort or a stop).

Source

pub fn nominal_seek_micros(&self, distance: u32) -> u32

The table seek time in microseconds for a jump of distance sectors, before variance. Linear between measured points (an assumption).

Source

pub fn read(&mut self, lba: u32, sectors: u32) -> (u64, bool)

Time to read sectors sectors starting at lba, moving the head. A read that starts where the head already is needs no seek (the transport chains contiguous requests). Returns (micros, seeked).

Trait Implementations§

Source§

impl Clone for DriveModel

Source§

fn clone(&self) -> DriveModel

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DriveModel

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for DriveModel

§

impl RefUnwindSafe for DriveModel

§

impl Send for DriveModel

§

impl Sync for DriveModel

§

impl Unpin for DriveModel

§

impl UnsafeUnpin for DriveModel

§

impl UnwindSafe for DriveModel

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.