pub struct FdsDisk { /* private fields */ }Expand description
A parsed FDS disk image: an ordered list of disk sides.
Implementations§
Source§impl FdsDisk
impl FdsDisk
Sourcepub fn side_count(&self) -> usize
pub fn side_count(&self) -> usize
Number of disk sides in this image.
Sourcepub fn declared_side_count(&self) -> u8
pub fn declared_side_count(&self) -> u8
Side count declared by the container header (0 when headerless).
Sourcepub fn side(&self, idx: usize) -> &[u8] ⓘ
pub fn side(&self, idx: usize) -> &[u8] ⓘ
Borrow the raw bytes of side idx (panics if out of range — callers use
Self::side_count to bound).
Sourcepub fn side_mut(&mut self, idx: usize) -> &mut [u8] ⓘ
pub fn side_mut(&mut self, idx: usize) -> &mut [u8] ⓘ
Mutably borrow the raw bytes of side idx (panics if out of range).
Used by the disk-write path to store bytes at the head position.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Re-serialize every side back to the headerless .fds byte layout
(side_count × FDS_SIDE_LEN bytes, concatenated). This is the form a
host writes to a side-car .fds.sav so the modified disk persists. The
fwNES 16-byte header is intentionally omitted — the headerless form
round-trips through parse_fds (its first side opens with the
\x01*NINTENDO-HVC* disk-info signature).