Skip to main content

LisaFilesystem

Struct LisaFilesystem 

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

A read-only view over an Apple Lisa File System floppy image.

Implementations§

Source§

impl LisaFilesystem

Source

pub fn open<R: Read + Seek>(reader: R) -> Result<Self, FilesystemError>

Open a Lisa File System image. reader must cover the whole DiskCopy 4.2 file (header + data + tags) — not the unwrapped data region, which would have discarded the tags this filesystem depends on.

Source

pub fn from_parts(data: Vec<u8>, tags: Vec<u8>) -> Result<Self, FilesystemError>

Construct directly from a de-containerized (data, tags) pair — the media-agnostic seam any producer can target: DiskCopy 4.2 today (via open), a DART decompressor or a Twiggy de-interleaver later. data must be numblocks * 512 bytes and tags exactly numblocks * 12.

Trait Implementations§

Source§

impl Filesystem for LisaFilesystem

Source§

fn root(&mut self) -> Result<FileEntry, FilesystemError>

Get the root directory entry.
Source§

fn list_directory( &mut self, entry: &FileEntry, ) -> Result<Vec<FileEntry>, FilesystemError>

List the contents of a directory.
Source§

fn read_file( &mut self, entry: &FileEntry, max_bytes: usize, ) -> Result<Vec<u8>, FilesystemError>

Read file contents (up to max_bytes).
Source§

fn write_file_to( &mut self, entry: &FileEntry, writer: &mut dyn Write, ) -> Result<u64, FilesystemError>

Stream file data to a writer. Returns the number of bytes written. Read more
Source§

fn fs_type(&self) -> &str

Filesystem type name (e.g., “FAT16”, “FAT32”).
Source§

fn volume_label(&self) -> Option<&str>

Volume label, if available.
Source§

fn total_size(&self) -> u64

Total filesystem size in bytes.
Source§

fn used_size(&self) -> u64

Used space in bytes.
Source§

fn allocation_unit(&self) -> Option<u64>

Allocation unit (cluster / block) size in bytes, when the filesystem has a single fixed one. The cross-image copy preflight uses this to project real on-disk consumption — many small files each round up to one unit, so summing raw byte sizes badly underestimates usage on large-cluster volumes. None means “unknown”; the copy engine then falls back to a 512-byte floor.
Source§

fn last_data_byte(&mut self) -> Result<u64, FilesystemError>

Returns the minimum number of bytes from the partition start needed to capture all filesystem data without moving any data on disk — i.e. the position of the last allocated byte. Used for smart backup trimming. Read more
Source§

fn defragmented_minimum_size(&mut self) -> Result<u64, FilesystemError>

Returns the minimum partition size that could host all live filesystem data after a defragmenting clone (data packed from offset 0). Read more
Source§

fn fragmentation_stats( &mut self, ) -> Option<Result<FragmentationStats, FilesystemError>>

Returns per-fork fragmentation statistics for this volume, or None when the filesystem can’t compute them (e.g. cluster-allocation filesystems whose CompactReader already repacks during the backup stream so “fragmentation” doesn’t translate into a backup-time decision the user can make). Read more
Source§

fn write_resource_fork_to( &mut self, _entry: &FileEntry, _writer: &mut dyn Write, ) -> Result<u64, FilesystemError>

Write resource fork data to a writer. Returns the number of bytes written. Default returns Ok(0) (no resource fork).
Source§

fn resource_fork_size(&mut self, _entry: &FileEntry) -> u64

Returns the resource fork size for a file entry. Default returns 0.
Source§

fn blessed_system_folder(&mut self) -> Option<(u64, String)>

Returns the CNID and name of the blessed (bootable) system folder, if set. Only meaningful for HFS/HFS+.
Source§

fn fsck(&mut self) -> Option<Result<FsckResult, FilesystemError>>

Run filesystem integrity check. Returns None if not supported for this filesystem type. Override in implementations that support fsck.
Source§

fn set_show_deleted(&mut self, _on: bool) -> bool

List deleted-but-readable entries alongside live ones; false when unsupported.
Source§

fn journal_detail( &mut self, ) -> Result<Option<Box<dyn Any + Send>>, FilesystemError>

Decode the journal into per-transaction detail for a history viewer; Ok(None) if unjournaled. The value is the filesystem’s own detail type (HFS+: JournalDetail), for the caller to downcast.
Source§

fn validate_name(&self, name: &str) -> Result<(), FilesystemError>

Validate that name is legal for a new file or directory on this filesystem. Returns Err(InvalidData) with a human-readable reason when the name violates length, character, or encoding rules. Read more
Source§

fn uses_colon_paths(&self) -> bool

True when this filesystem reserves : as its native path separator (classic Mac HFS / HFS+), so : can never appear in a catalog name. Read more
Source§

fn case_insensitive_lookup(&self) -> bool

Whether name lookup falls back to case-insensitive matching, the way the native OS resolves paths on this filesystem; an exact match wins first.
Source§

fn supports_xattrs(&self) -> bool

Whether this filesystem stores POSIX extended attributes (user.*, security.*, …). True on ext / XFS / SquashFS; false on filesystems with no xattr concept (Minix, EFS, FAT, HFS). The UI uses this to show or hide the xattr section rather than probing every file.
Source§

fn list_xattrs( &mut self, _entry: &FileEntry, ) -> Result<Vec<Xattr>, FilesystemError>

Read the extended attributes on entry. Default: none. Override on xattr-bearing filesystems. Returning an empty list is normal — most files carry no xattrs even where the filesystem supports them.

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.