pub struct PO { /* private fields */ }Expand description
Wrapper for PO data.
Implementations§
Trait Implementations§
Source§impl DiskImage for PO
impl DiskImage for PO
Source§fn track_count(&self) -> usize
fn track_count(&self) -> usize
Get the count of formatted tracks, not necessarily the same as
end_trackfn num_heads(&self) -> usize
Source§fn nominal_capacity(&self) -> Option<usize>
fn nominal_capacity(&self) -> Option<usize>
Get the capacity in bytes supposing this disk were formatted in a standard way.
May return
None if format hints are insufficient.Source§fn actual_capacity(&mut self) -> Result<usize, Box<dyn Error>>
fn actual_capacity(&mut self) -> Result<usize, Box<dyn Error>>
Get the capacity in bytes given the way the disk is actually formatted.
The expense can be high, and may change the disk state.
Source§fn read_block(&mut self, addr: Block) -> Result<Vec<u8>, Box<dyn Error>>
fn read_block(&mut self, addr: Block) -> Result<Vec<u8>, Box<dyn Error>>
Read a block from the image; can affect disk state
Source§fn write_block(&mut self, addr: Block, dat: &[u8]) -> Result<(), Box<dyn Error>>
fn write_block(&mut self, addr: Block, dat: &[u8]) -> Result<(), Box<dyn Error>>
Write a block to the image
Source§fn read_sector(
&mut self,
_trk: Track,
_sec: Sector,
) -> Result<Vec<u8>, Box<dyn Error>>
fn read_sector( &mut self, _trk: Track, _sec: Sector, ) -> Result<Vec<u8>, Box<dyn Error>>
Read a physical sector from the image; can affect disk state.
Source§fn write_sector(
&mut self,
_trk: Track,
_sec: Sector,
_dat: &[u8],
) -> Result<(), Box<dyn Error>>
fn write_sector( &mut self, _trk: Track, _sec: Sector, _dat: &[u8], ) -> Result<(), Box<dyn Error>>
Write a physical sector to the image
fn from_bytes(data: &[u8]) -> Result<Self, DiskStructError>
fn what_am_i(&self) -> DiskImageType
fn file_extensions(&self) -> Vec<String>
fn kind(&self) -> DiskKind
Source§fn change_kind(&mut self, kind: DiskKind)
fn change_kind(&mut self, kind: DiskKind)
Change the kind of disk, but do not change the format
fn to_bytes(&mut self) -> Vec<u8> ⓘ
Source§fn get_track_buf(&mut self, _trk: Track) -> Result<Vec<u8>, Box<dyn Error>>
fn get_track_buf(&mut self, _trk: Track) -> Result<Vec<u8>, Box<dyn Error>>
Get the track buffer exactly in the form the image stores it
Source§fn set_track_buf(
&mut self,
_trk: Track,
_dat: &[u8],
) -> Result<(), Box<dyn Error>>
fn set_track_buf( &mut self, _trk: Track, _dat: &[u8], ) -> Result<(), Box<dyn Error>>
Set the track buffer using another track buffer, the sizes must match
Source§fn get_track_solution(
&mut self,
_trk: Track,
) -> Result<TrackSolution, Box<dyn Error>>
fn get_track_solution( &mut self, _trk: Track, ) -> Result<TrackSolution, Box<dyn Error>>
Determined sector layout and update internal formatting hints.
Implement this at a low level, making as few assumptions as possible.
The expense of this operation can vary widely depending on the image type.
Source§fn get_track_nibbles(&mut self, _trk: Track) -> Result<Vec<u8>, Box<dyn Error>>
fn get_track_nibbles(&mut self, _trk: Track) -> Result<Vec<u8>, Box<dyn Error>>
Get the track bytes as aligned nibbles; for user inspection
Source§fn display_track(&self, _bytes: &[u8]) -> String
fn display_track(&self, _bytes: &[u8]) -> String
Write the track to a string suitable for display, input should be pre-aligned nibbles, e.g. from
get_track_nibbles.
Any required details of the track format have to come from the internal state of the image.fn motor_steps_per_cyl(&self) -> usize
Source§fn get_rz(&self, trk: Track) -> Result<[usize; 2], Box<dyn Error>>
fn get_rz(&self, trk: Track) -> Result<[usize; 2], Box<dyn Error>>
Get the geometric [cyl,head]. Default truncates fractional tracks in a reasonable
way if there are either 1 or 4 steps per track.
Source§fn get_track(&self, trk: Track) -> Result<usize, Box<dyn Error>>
fn get_track(&self, trk: Track) -> Result<usize, Box<dyn Error>>
Get the geometric track. Default truncates fractional tracks in a reasonable
way if there are either 1 or 4 steps per track.
Source§fn get_rzq(&self, trk: Track, sec: Sector) -> Result<[usize; 3], Box<dyn Error>>
fn get_rzq(&self, trk: Track, sec: Sector) -> Result<[usize; 3], Box<dyn Error>>
Get the geometric [cyl,head,sec].
Default truncates fractional tracks in a reasonable way if there are either 1 or 4 steps per track.
If an explicit address is given, the sector will be taken from the most likely address byte.
Source§fn change_format(&mut self, _fmt: DiskFormat) -> Result<(), Box<dyn Error>>
fn change_format(&mut self, _fmt: DiskFormat) -> Result<(), Box<dyn Error>>
Change details of how sectors are identified and decoded
Source§fn change_method(&mut self, _method: Method)
fn change_method(&mut self, _method: Method)
Change the broad method by which nibbles are extracted from a track.
Emulate will try to produce nibbles just as the hardware would.
Fast and Analyze will show something more idealized.Source§fn get_metadata(&self, indent: Option<u16>) -> String
fn get_metadata(&self, indent: Option<u16>) -> String
Get image metadata into JSON string.
Default contains only the image type.
Source§fn put_metadata(
&mut self,
key_path: &Vec<String>,
_val: &JsonValue,
) -> Result<(), Box<dyn Error>>
fn put_metadata( &mut self, key_path: &Vec<String>, _val: &JsonValue, ) -> Result<(), Box<dyn Error>>
Add or change a single metadata item. This is designed to take as its arguments the
outputs produced by walking a JSON tree with
crate::JsonCursor.
The key_path has the keys leading up to the leaf, e.g., /type/item/_raw, and
the val is the JSON value associated with the leaf (anything but an object).
The special keys _raw and _pretty should be handled as follows.
If a leaf is neither _raw nor _pretty treat it as raw.
If a leaf is _pretty ignore it.Auto Trait Implementations§
impl Freeze for PO
impl RefUnwindSafe for PO
impl Send for PO
impl Sync for PO
impl Unpin for PO
impl UnwindSafe for PO
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
Mutably borrows from an owned value. Read more