Struct cbm::disk::D64 [−][src]
pub struct D64 { /* fields omitted */ }
Represent a 1541 disk image in D64 format. Geometries for this disk image type can describe either 35-track or 40-track disks and images with and without attached error tables.
Methods
impl D64
[src]
impl D64
pub fn open<P: AsRef<Path>>(path: P, writable: bool) -> Result<D64>
[src]
pub fn open<P: AsRef<Path>>(path: P, writable: bool) -> Result<D64>
Open an existing D64 disk image as read-only (if writable
is false)
or read-write (if writable
is true).
pub fn create<P: AsRef<Path>>(
path: P,
geometry: &Geometry,
create_new: bool
) -> Result<D64>
[src]
pub fn create<P: AsRef<Path>>(
path: P,
geometry: &Geometry,
create_new: bool
) -> Result<D64>
Create a new D64 disk image. If create_new
is true, no file is
allowed to exist at the target location. If false, any existing
file will be overwritten.
pub fn open_memory(geometry: &Geometry) -> Result<D64>
[src]
pub fn open_memory(geometry: &Geometry) -> Result<D64>
Create a new in-memory D64 disk image.
pub fn geometry(with_error_table: bool) -> &'static Geometry
[src]
pub fn geometry(with_error_table: bool) -> &'static Geometry
Return the 35-track geometry for D64 disks.
pub fn geometry_40_tracks(with_error_table: bool) -> &'static Geometry
[src]
pub fn geometry_40_tracks(with_error_table: bool) -> &'static Geometry
Return the 40-track geometry for D64 disks.
Trait Implementations
impl Disk for D64
[src]
impl Disk for D64
fn native_disk_format(&self) -> &'static DiskFormat
[src]
fn native_disk_format(&self) -> &'static DiskFormat
fn disk_format(&self) -> Result<&DiskFormat>
[src]
fn disk_format(&self) -> Result<&DiskFormat>
fn disk_format_mut(&mut self) -> Result<&mut DiskFormat>
[src]
fn disk_format_mut(&mut self) -> Result<&mut DiskFormat>
fn set_disk_format(&mut self, disk_format: Option<DiskFormat>)
[src]
fn set_disk_format(&mut self, disk_format: Option<DiskFormat>)
fn blocks(&self) -> Rc<RefCell<BlockDevice>>
[src]
fn blocks(&self) -> Rc<RefCell<BlockDevice>>
fn blocks_ref(&self) -> Ref<BlockDevice>
[src]
fn blocks_ref(&self) -> Ref<BlockDevice>
fn blocks_ref_mut(&self) -> RefMut<BlockDevice>
[src]
fn blocks_ref_mut(&self) -> RefMut<BlockDevice>
fn header<'a>(&'a self) -> Result<&'a Header>
[src]
fn header<'a>(&'a self) -> Result<&'a Header>
fn header_mut<'a>(&'a mut self) -> Result<&'a mut Header>
[src]
fn header_mut<'a>(&'a mut self) -> Result<&'a mut Header>
fn set_header(&mut self, header: Option<Header>)
[src]
fn set_header(&mut self, header: Option<Header>)
fn flush_header(&mut self) -> Result<()>
[src]
fn flush_header(&mut self) -> Result<()>
fn bam(&self) -> Result<Rc<RefCell<BAM>>>
[src]
fn bam(&self) -> Result<Rc<RefCell<BAM>>>
fn set_bam(&mut self, bam: Option<BAM>)
[src]
fn set_bam(&mut self, bam: Option<BAM>)
fn initialize(&mut self)
[src]
fn initialize(&mut self)
Initialize the disk by reading the format metadata, if any. This may be called again, for example, when the BAM or header have been re-written. Read more
fn write_format(&mut self, name: &Petscii, id: &Id) -> Result<()>
[src]
fn write_format(&mut self, name: &Petscii, id: &Id) -> Result<()>
Format the disk image. Currently, this does not accurately reflect the exact formatting method used by the 1541/1571/1581 CBM DOS. Read more
ⓘImportant traits for DirectoryIteratorfn iter(&self) -> DirectoryIterator
[src]
fn iter(&self) -> DirectoryIterator
Return an iterator of directory entries found on this disk image.
fn directory(&self) -> Result<Vec<DirectoryEntry>>
[src]
fn directory(&self) -> Result<Vec<DirectoryEntry>>
Return a list of all directory entries
fn find_directory_entry(&self, filename: &Petscii) -> Result<DirectoryEntry>
[src]
fn find_directory_entry(&self, filename: &Petscii) -> Result<DirectoryEntry>
Locate a directory entry based on its filename.
fn next_free_directory_entry(&mut self) -> Result<DirectoryEntry>
[src]
fn next_free_directory_entry(&mut self) -> Result<DirectoryEntry>
Return a DirectoryEntry
representing the next free slot on the directory track. This entry may be used to create a new directory entry by populating its fields and passing it to write_directory_entry()
. Read more
fn write_directory_entry(&mut self, entry: &DirectoryEntry) -> Result<()>
[src]
fn write_directory_entry(&mut self, entry: &DirectoryEntry) -> Result<()>
Write the the provide directory entry to disk, using the same slot as it was originally read from. Read more
fn check_filename_availability(&self, filename: &Petscii) -> Result<()>
[src]
fn check_filename_availability(&self, filename: &Petscii) -> Result<()>
Confirm that no directory entry currently exists with the provided filename. Read more
fn rename(
&mut self,
original_filename: &Petscii,
new_filename: &Petscii
) -> Result<()>
[src]
fn rename(
&mut self,
original_filename: &Petscii,
new_filename: &Petscii
) -> Result<()>
Rename a file.
fn open_file(&self, filename: &Petscii) -> Result<File>
[src]
fn open_file(&self, filename: &Petscii) -> Result<File>
Open a file based on its filename.
fn open_file_from_entry(&self, entry: &DirectoryEntry) -> Result<File>
[src]
fn open_file_from_entry(&self, entry: &DirectoryEntry) -> Result<File>
Open a file based on its directory entry.
fn create_file(
&mut self,
filename: &Petscii,
file_type: FileType,
scheme: Scheme
) -> Result<File>
[src]
fn create_file(
&mut self,
filename: &Petscii,
file_type: FileType,
scheme: Scheme
) -> Result<File>
Create a new file on the disk. It will be initialized as a closed zero-length file, and a file handle will be returned which may be used to provision a writer. Read more
fn read_sector<'a>(&self, location: Location) -> Result<Vec<u8>>
[src]
fn read_sector<'a>(&self, location: Location) -> Result<Vec<u8>>
Read a specific block from the disk, given its track and sector location. Read more
fn write_sector(&mut self, location: Location, data: &[u8]) -> Result<()>
[src]
fn write_sector(&mut self, location: Location, data: &[u8]) -> Result<()>
Write a block of data to a specific location on the disk.
fn dump(&mut self, writer: &mut Write) -> Result<()>
[src]
fn dump(&mut self, writer: &mut Write) -> Result<()>
Write a hex dump of the disk image to the provided writer.
fn name<'a>(&'a self) -> Option<&'a Petscii>
[src]
fn name<'a>(&'a self) -> Option<&'a Petscii>
Return the name of this disk as found in the disk header.
fn validate(&self) -> Result<Vec<ValidationError>>
[src]
fn validate(&self) -> Result<Vec<ValidationError>>
Check the consistency of the disk image. Unlike the "validate" ("v0:") command in CBM DOS, this is a read-only operation and does not attempt any repairs. A list of validation errors is returned. Read more
fn blocks_free(&self) -> Result<usize>
[src]
fn blocks_free(&self) -> Result<usize>
Return the blocks free based on the BAM free sector counts. (Not based on the BAM bitmaps, nor on the file sizes in the directory entries.) Read more