pub struct LisaFilesystem { /* private fields */ }Expand description
A read-only view over an Apple Lisa File System floppy image.
Implementations§
Source§impl LisaFilesystem
impl LisaFilesystem
Sourcepub fn open<R: Read + Seek>(reader: R) -> Result<Self, FilesystemError>
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.
Sourcepub fn from_parts(data: Vec<u8>, tags: Vec<u8>) -> Result<Self, FilesystemError>
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
impl Filesystem for LisaFilesystem
Source§fn list_directory(
&mut self,
entry: &FileEntry,
) -> Result<Vec<FileEntry>, FilesystemError>
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>
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>
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 volume_label(&self) -> Option<&str>
fn volume_label(&self) -> Option<&str>
Volume label, if available.
Source§fn total_size(&self) -> u64
fn total_size(&self) -> u64
Total filesystem size in bytes.
Source§fn allocation_unit(&self) -> Option<u64>
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>
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>
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>>
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 moreSource§fn write_resource_fork_to(
&mut self,
_entry: &FileEntry,
_writer: &mut dyn Write,
) -> Result<u64, FilesystemError>
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
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)>
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>>
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
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>
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>
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 moreSource§fn uses_colon_paths(&self) -> bool
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 moreSource§fn case_insensitive_lookup(&self) -> bool
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
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>
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§
impl Freeze for LisaFilesystem
impl RefUnwindSafe for LisaFilesystem
impl Send for LisaFilesystem
impl Sync for LisaFilesystem
impl Unpin for LisaFilesystem
impl UnsafeUnpin for LisaFilesystem
impl UnwindSafe for LisaFilesystem
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