TrackEngine

Struct TrackEngine 

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

This is the main interface for interacting with any GCR track data. It maintains the state of the controller, but does not own either the track data or the format information.

Implementations§

Source§

impl TrackEngine

Source

pub fn create(method: Method, nib_filter: bool) -> Self

create a new track engine, any machine state is lost

Source

pub fn change_method(&mut self, method: Method)

change the method used process the data stream

Source

pub fn read_sector( &mut self, cells: &mut FluxCells, hood: &SectorHood, sec: &Sector, fmt: &ZoneFormat, ) -> Result<Vec<u8>, Box<dyn Error>>

Source

pub fn write_sector( &mut self, cells: &mut FluxCells, dat: &[u8], hood: &SectorHood, sec: &Sector, fmt: &ZoneFormat, ) -> Result<(), Box<dyn Error>>

Source

pub fn to_nibbles(&mut self, cells: &mut FluxCells, fmt: &ZoneFormat) -> Vec<u8>

dump nibble stream starting on an address prolog continuing through one revolution

Source

pub fn get_sector_map( &mut self, cells: &mut FluxCells, fmt: &ZoneFormat, ) -> Result<(Vec<[u8; 6]>, Vec<usize>), Box<dyn Error>>

return vectors of sector addresses and sizes in geometric order for user consumption

Source

pub fn format_track( &mut self, hood: SectorHood, buf_len: usize, fmt: &ZoneFormat, ) -> Result<FluxCells, Box<dyn Error>>

Create a GCR track based on the given ZoneFormat (currently Apple only).

  • hood - standard address components, in general will be transformed by fmt
  • buf_len - length of the buffer in which track bits will be loaded (usually padded, only used as a check)
  • fmt - defines the track format to be used
  • returns - FluxCells object. There is some special handling to emulate the way different versions of Apple DOS would format the track.

Auto Trait Implementations§

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, 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 = Infallible

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.