Skip to main content

Crate disk_core

Crate disk_core 

Source
Expand description

The base crate under every rusty-backup filesystem, partition and disk-image crate.

Always available:

  • io_other / repeat_n: std shims that build on both current Rust and Rust 1.73 (the last toolchain whose std targets macOS 10.7).
  • display: small neutral formatters (sizes, Mac OSType, Unix modes).
  • bits: big-endian allocation-bitmap helpers (HFS, HFS+, ProDOS).
  • sgi: the 16-bit word order of SGI disk images.
  • rust173 (feature rust173-polyfill only): extension traits standing in for std methods missing on 1.73. Never enable it on a modern toolchain.

With the fs feature (on by default), the interface every filesystem crate (fs-8bit, fs-mac, …) implements:

  • filesystem: Filesystem (read) and EditableFilesystem (write), FilesystemError, create/repair options.
  • attrs: resolve the attributes a copied or imported entry should get.
  • entry: FileEntry, EntryType and directory display ordering.
  • id_names: uid / gid names from an image’s own /etc/passwd and /etc/group.
  • fsck: integrity-check results shared by every checker.
  • times: Unix timestamps and the calendar conversions filesystems need.
  • xattr: extended-attribute names and values.
  • unix_common: inode helpers (timestamps, permission bits, uid / gid width) shared by every family with Unix-style metadata.
  • name_legalize: turn any name into one a destination’s validate_name accepts.
  • raw_name: keep non-UTF-8 name bytes intact through a String.
  • stream_pipe: copy a file between two filesystems without holding it in memory.

Partition and disk-image crates depend on this with default-features = false and so build without the filesystem types and their dependencies.

Modules§

attrs
Where a new file’s POSIX mode / uid / gid actually come from.
bits
Big-endian (MSB-first) allocation-bitmap helpers, as used by HFS, HFS+ and ProDOS.
display
Small, filesystem-neutral formatters used when showing entries to a person.
entry
filesystem
fsck
Shared filesystem check (fsck) and repair types.
id_names
Resolve numeric uid/gid to names by reading the image’s own /etc/passwd and /etc/group.
name_legalize
Make a filename legal on a destination filesystem, whatever its rules.
raw_name
Byte-exact on-disk names through the &str filesystem API.
sgi
16-bit word order of SGI (MIPS / 68020) disk images, shared by the volume label and EFS.
stream_pipe
Copy a file between two filesystems without holding it in memory.
times
Per-file Unix timestamps shared across the create / import / export paths, plus the format-specific encoders every non-Unix driver needs to write those same times into its own on-disk shape.
unix_common
xattr
Shared extended-attribute type, used across every filesystem that carries POSIX-style xattrs (SquashFS, ext, XFS).

Functions§

io_other
Construct an io::Error of kind Other wrapping error.
repeat_n
An iterator that repeats value exactly count times.