Skip to main content

DiskImage

Enum DiskImage 

Source
pub enum DiskImage<'a> {
    STX(STXDisk<'a>),
    Apple(AppleDisk<'a>),
}
Expand description

DiskImage is the primary enumeration for holding disk images.

The DiskImageParser and DiskImageSaver trait functions return and operate on this enumeration.

Because the Disk data structures are more intelligent than simple byte-oriented C structures, copying them isn’t as easy as copying a block of bytes. rust-clippy recommends boxing the large fields to reduce the total size of the enum. This is a new recommendation, we’ll ignore it for now and investigate other solution. DiskImage construction is usually done once at the beginning of the program, and total variant size is still around ~512 bytes On normal invocations in the current codebase we only have one instance of this enum. Future versions may have more, but for now the cost is not an issue. If this code is adapted to process a large number of images and thrashing is a concern, feel free to fix it.

Variants§

§

STX(STXDisk<'a>)

An Atari ST STX Disk Image. Usually the raw data in a STX disk image is a FAT12 filesystem.

§

Apple(AppleDisk<'a>)

An Apple ][ Disk Image There are several different encodings, formats, and filesystems for Apple2 disks. This includes nibble encoding and DOS 3.x and ProDOS filesystems.

Trait Implementations§

Source§

impl<'a, 'b> DiskImageOps<'a, 'b> for DiskImage<'a>

Source§

fn catalog(&'a self, _config: &'b Config) -> Result<String, Error>

This function lists the contents of the disk It simply returns the root directory as a string Future versions could provide more structure Read more
Source§

impl DiskImageSaver for DiskImage<'_>

Source§

fn save_disk_image( &self, config: &Config, selected_filename: Option<&str>, filename: &str, ) -> Result<(), Error>

Save the primary data contents of a disk image to disk The meaning of the data contents will differ between image formats, but it’s usually all the volume, track, and sector data, or the enclosed file format if the outer image is a wrapper. This function parses an entire disk, returning a DiskImage. Read more
Source§

impl Display for DiskImage<'_>

Display a DiskImage

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DiskImage<'a>

§

impl<'a> RefUnwindSafe for DiskImage<'a>

§

impl<'a> Send for DiskImage<'a>

§

impl<'a> Sync for DiskImage<'a>

§

impl<'a> Unpin for DiskImage<'a>

§

impl<'a> UnsafeUnpin for DiskImage<'a>

§

impl<'a> UnwindSafe for DiskImage<'a>

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,