Skip to main content

FsKind

Struct FsKind 

Source
pub struct FsKind(/* private fields */);
Expand description

The filesystem family — the canonical identity newtype from forensicnomicon-core (FsKind::NTFS, FsKind::EXT, …). Canonical identity of a filesystem, content-addressed by a stable lowercase name.

A newtype over &'static str (not an enum) so the set is open: adding a filesystem is a new const here, never a breaking change to a downstream contract crate. Every filesystem is a uniform const — none is a first-class variant and none is a stringly-typed Other.

Intended as the single source of the identity that forensic-vfs::FsKind re-exports, retiring its named-variants-plus-Other enum.

The names here are the canonical identity labels; they intentionally differ from the human-facing detection names in FILESYSTEM_SIGNATURES (e.g. identity ext vs. the signature label ext2/3/4). Identity and detection are kept as two separate concerns; this type carries no magics.

Implementations§

Source§

impl FsKind

Source

pub const NTFS: FsKind

NTFS.

Source

pub const FAT: FsKind

FAT (FAT12/16/32 family).

Source

pub const EXFAT: FsKind

exFAT.

Source

pub const EXT: FsKind

ext2/3/4 family.

Source

pub const XFS: FsKind

XFS.

Source

pub const APFS: FsKind

Apple APFS.

Source

pub const HFS_PLUS: FsKind

Apple HFS+.

Source

pub const ISO9660: FsKind

ISO 9660 optical filesystem.

Source

pub const UDF: FsKind

UDF optical filesystem.

Source

pub const BTRFS: FsKind

Btrfs.

Source

pub const ZFS: FsKind

ZFS.

Source

pub const UFS: FsKind

UFS/FFS.

Source

pub const REFS: FsKind

Microsoft ReFS.

Source

pub const ZIP: FsKind

ZIP archive-as-container.

Source

pub const AD1: FsKind

AccessData AD1 logical-image container.

Source

pub const DAR: FsKind

DAR (Disk ARchive) container.

Source

pub const UNKNOWN_FALLBACK: FsKind = FsKind::NTFS

Documented fallback for a name outside known. A runtime string cannot be promoted to a &'static str without leaking, so deserializing an unrecognized name collapses to this single sentinel (the first registered kind) rather than allocating or panicking. Callers needing strict validation compare the input against known before trusting a deserialized value.

Source

pub const fn as_str(&self) -> &'static str

The stable lowercase identifier — round-trips, safe for logs / JSON / URIs.

Source

pub const fn from_name(name: &'static str) -> FsKind

Construct from a compile-time name. Returns a kind wrapping the given static string; pass one of the const names to get a registered kind.

Source

pub fn known() -> &'static [FsKind]

All registered kinds — lets consumers enumerate/validate without a closed enum.

Not const fn: referencing a static from a const fn (const_refs_to_static) only stabilized in Rust 1.83, and this crate’s MSRV is 1.75. A plain fn returning the 'static slice works on every supported toolchain.

Trait Implementations§

Source§

impl Clone for FsKind

Source§

fn clone(&self) -> FsKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FsKind

Source§

impl Debug for FsKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for FsKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for FsKind

Source§

impl Hash for FsKind

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FsKind

Source§

fn eq(&self, other: &FsKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FsKind

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.