Skip to main content

DistroId

Enum DistroId 

Source
pub enum DistroId {
    Fedora {
        version: u32,
    },
    FedoraSilverblue {
        version: u32,
    },
    Ubuntu {
        major: u32,
        minor: u32,
    },
    UbuntuCore {
        major: u32,
        minor: u32,
    },
    Debian {
        version: Option<u32>,
    },
    Other {
        id: String,
        version_id: Option<String>,
        id_like: Vec<String>,
    },
}
Expand description

Typed distro identity derived from OsRelease.

Variants§

§

Fedora

Plain Fedora (Workstation, Server, …).

Fields

§version: u32
§

FedoraSilverblue

Fedora Silverblue, Kinoite, or Sericea (immutable desktops).

Fields

§version: u32
§

Ubuntu

Ubuntu LTS or interim.

Fields

§major: u32
§minor: u32
§

UbuntuCore

Ubuntu Core (IoT).

Fields

§major: u32
§minor: u32
§

Debian

Debian.

Fields

§version: Option<u32>
§

Other

Any other distro — fields forwarded from OsRelease.

Fields

§version_id: Option<String>
§id_like: Vec<String>

ID_LIKE tokens, carried through so DistroId::family can make a best-effort derivative-family guess (see that method’s doc comment). Empty when ID_LIKE was absent.

Implementations§

Source§

impl DistroId

Source

pub fn family(&self) -> DistroFamily

Returns the broad family this distro belongs to.

§ID_LIKE fallback for unrecognised derivatives

When self is Other (the running distro’s ID did not match any distro this crate detects directly — e.g. Linux Mint ID=linuxmint, Pop!_OS ID=pop), this consults ID_LIKE before giving up: if it contains "debian" or "ubuntu" the distro routes as DistroFamily::Debian; if it contains "fedora" or "rhel" it routes as DistroFamily::Fedora. This is best-effort derivative support, not full compatibility validation — ID_LIKE is a hint the distro maintainer supplies in /etc/os-release (see os-release(5)), not a guarantee the derivative’s package manager, repositories, or service names are wire-compatible with the parent. Actions may still fail at execution time on a derivative that diverges from its stated parent.

Source

pub fn is_supported(&self) -> bool

Returns true for distros and versions with a shipped action backend.

Support policy:

  • Ubuntu 20.04 and later, every release: LTS and interim alike. Ubuntu is the supported platform, so eligibility must not depend on the LTS cadence — the apt, snap, ufw and netplan tooling every action drives is present across those releases.
  • Fedora Atomic variants 41+ (Silverblue, Kinoite, and siblings) are eligible too. The rpm-ostree action families work; the difference from Ubuntu is validation effort, not support, because Ubuntu has far more users. See docs/distro-support.md.
§Eligibility is not validation coverage

This predicate answers “may SysKnife act on this host at all” — the daemon refuses every mutating action when it is false. It is not a claim that a release has been VM-validated; docs/distro-support.md tracks validation tiers separately, and a release can be supported here while listed as smoke-tested there.

Releases below 20.04 are excluded because they no longer receive Ubuntu security updates. UbuntuCore is excluded for a structural reason rather than an age one: it has no apt and a read-only root, so the Debian-family action set cannot apply. Plain Fedora stays detectable so the planner can explain the gap rather than fail opaquely.

Trait Implementations§

Source§

impl Clone for DistroId

Source§

fn clone(&self) -> DistroId

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 Debug for DistroId

Source§

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

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

impl Display for DistroId

Source§

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

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

impl Eq for DistroId

Source§

impl PartialEq for DistroId

Source§

fn eq(&self, other: &DistroId) -> 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 DistroId

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.