AffsReaderVar

Struct AffsReaderVar 

Source
pub struct AffsReaderVar<'a, D: SectorDevice> { /* private fields */ }
Expand description

Variable block size AFFS reader.

This reader supports AFFS filesystems with block sizes from 512 to 8192 bytes, as used on Amiga hard disk partitions. The block size is determined by probing the root block at different sizes until the checksum validates.

Implementations§

Source§

impl<'a, D: SectorDevice> AffsReaderVar<'a, D>

Source

pub fn new(device: &'a D, total_sectors: u64) -> Result<Self, AffsError>

Create a new variable block size AFFS reader.

This probes the filesystem to determine the block size by trying different block sizes until the root block checksum validates.

§Arguments
  • device - Sector device to read from
  • total_sectors - Total number of 512-byte sectors on the device
Source

pub const fn fs_type(&self) -> FsType

Get the filesystem type (OFS or FFS).

Source

pub const fn fs_flags(&self) -> FsFlags

Get filesystem flags.

Source

pub const fn root_block(&self) -> u32

Get the root block number.

Source

pub const fn total_blocks(&self) -> u32

Get the total number of blocks.

Source

pub const fn block_size(&self) -> usize

Get the block size in bytes.

Source

pub const fn log_blocksize(&self) -> u8

Get the log2 block size (relative to 512).

Source

pub fn disk_name(&self) -> &[u8]

Get the disk name (volume label) as bytes.

Source

pub fn disk_name_str(&self) -> Option<&str>

Get the disk name (volume label) as a string (if valid UTF-8).

Source

pub fn label(&self) -> &[u8]

Get the volume label (alias for disk_name).

Source

pub fn label_str(&self) -> Option<&str>

Get the volume label as string (alias for disk_name_str).

Source

pub const fn creation_date(&self) -> AmigaDate

Get the volume creation date.

Source

pub const fn last_modified(&self) -> AmigaDate

Get the volume last modification date.

Source

pub fn mtime(&self) -> i64

Get the volume modification time as Unix timestamp.

This matches GRUB’s grub_affs_mtime() behavior:

  • days * 86400 + min * 60 + hz / 50 + epoch offset
Source

pub const fn hash_table_size(&self) -> u32

Get the hash table size.

Source

pub const fn is_intl(&self) -> bool

Check if international mode is enabled.

Read a symlink target.

§Arguments
  • block - Block number of the symlink entry
  • out - Buffer to write the UTF-8 symlink target into
§Returns

The number of bytes written to out.

Source

pub fn read_root_dir(&self) -> Result<VarDirIter<'_, D>, AffsError>

Iterate over entries in the root directory.

Source

pub fn read_dir(&self, block: u32) -> Result<VarDirIter<'_, D>, AffsError>

Iterate over entries in a directory.

Auto Trait Implementations§

§

impl<'a, D> Freeze for AffsReaderVar<'a, D>

§

impl<'a, D> RefUnwindSafe for AffsReaderVar<'a, D>
where D: RefUnwindSafe,

§

impl<'a, D> Send for AffsReaderVar<'a, D>
where D: Sync,

§

impl<'a, D> Sync for AffsReaderVar<'a, D>
where D: Sync,

§

impl<'a, D> Unpin for AffsReaderVar<'a, D>

§

impl<'a, D> UnwindSafe for AffsReaderVar<'a, D>
where D: RefUnwindSafe,

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