pub struct Distro(/* private fields */);sys only.Expand description
OS distribution name.
This type provides type-safe OS distribution names.
It uses the newtype pattern with #[repr(transparent)] for zero-cost abstraction.
Implementations§
Source§impl Distro
impl Distro
Sourcepub fn new(s: &str) -> Result<Self, DistroError>
pub fn new(s: &str) -> Result<Self, DistroError>
Creates a new distribution name from a string.
§Errors
Returns an error DistroError if the string is not a valid distribution name.
Sourcepub const fn as_inner(&self) -> &String<64>
pub const fn as_inner(&self) -> &String<64>
Returns a reference to the underlying heapless::String.
Sourcepub fn into_inner(self) -> String<64>
pub fn into_inner(self) -> String<64>
Consumes this distribution name and returns the underlying string.
Sourcepub fn is_debian_based(&self) -> bool
pub fn is_debian_based(&self) -> bool
Returns true if this is a Debian-based distribution.
This includes Debian, Ubuntu, Linux Mint, Pop!_OS, Kali Linux, etc.
Sourcepub fn is_redhat_based(&self) -> bool
pub fn is_redhat_based(&self) -> bool
Returns true if this is a Red Hat-based distribution.
This includes Red Hat Enterprise Linux, Fedora, CentOS, Rocky Linux, AlmaLinux, etc.
Sourcepub fn is_arch_based(&self) -> bool
pub fn is_arch_based(&self) -> bool
Returns true if this is an Arch-based distribution.
This includes Arch Linux, Manjaro, EndeavourOS, etc.
Sourcepub fn is_rolling_release(&self) -> bool
pub fn is_rolling_release(&self) -> bool
Returns true if this is a rolling release distribution.
This includes Arch Linux, Gentoo, Fedora, Void Linux, Debian Sid, etc.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for Distro
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for Distro
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read more