OsRelease

Struct OsRelease 

Source
pub struct OsRelease {
Show 21 fields pub name: String, pub id: Option<String>, pub id_like: Option<String>, pub pretty_name: Option<String>, pub cpe_name: Option<String>, pub variant: Option<String>, pub variant_id: Option<String>, pub version: Option<String>, pub version_id: Option<String>, pub version_codename: Option<String>, pub build_id: Option<String>, pub image_id: Option<String>, pub image_version: Option<String>, pub home_url: Option<String>, pub documentation_url: Option<String>, pub support_url: Option<String>, pub bug_report_url: Option<String>, pub privacy_policy_url: Option<String>, pub logo: Option<String>, pub default_hostname: Option<String>, pub sysext_level: Option<String>,
}
Expand description

Information about installed distro from /etc/os-release

Information from freedesktop portal.

Fields§

§name: String

The operating system name without a version component

If not set, a default Linux value may be used

§id: Option<String>

A lower-case string identifying the OS, excluding any version information

§id_like: Option<String>

A space-separated list of operating system identifiers in the same syntax as the id param.

§pretty_name: Option<String>

A pretty OS name in a format suitable for presentation to the user. May or may not contain a release code or OS version of some kind, as suitable

§cpe_name: Option<String>

A CPE name for the OS, in URI binding syntax

§variant: Option<String>

Specific variant or edition of the OS suitable for presentation to the user

§variant_id: Option<String>

Lower-case string identifying a specific variant or edition of the OS

§version: Option<String>

The OS version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user

§version_id: Option<String>

A lower-case string identifying the OS version, excluding any OS name information or release code name

§version_codename: Option<String>

A lower-case string identifying the OS release code name, excluding any OS name information or release version

§build_id: Option<String>

A string uniquely identifying the system image originally used as the installation base

§image_id: Option<String>

A lower-case string, identifying a specific image of the OS. This is supposed to be used for envs where OS images are prepared, built, shipped and updated as comprehensive, consistent OS images

§image_version: Option<String>

A lower-case string identifying the OS image version. This is supposed to be used together with image_id describes above, to discern different versions of the same image

§home_url: Option<String>

Home URL of installed OS

§documentation_url: Option<String>

Documentation URL of installed OS

§support_url: Option<String>

Support URL of installed OS

§bug_report_url: Option<String>

URL for bug reports

§privacy_policy_url: Option<String>

URL with information about privacy policy of the installed OS

A string, specifying the name of an icon as defined by freedesktop.org Icon Theme Specification

§default_hostname: Option<String>

Default hostname if hostname(5) isn’t present and no other configuration source specifies the hostname

§sysext_level: Option<String>

A lower-case string identifying the OS extensions support level, to indicate which extension images are supported.

See systemd-sysext(8) for more information

Implementations§

Source§

impl OsRelease

Source

pub fn new() -> Result<Self>

Trait Implementations§

Source§

impl Clone for OsRelease

Source§

fn clone(&self) -> OsRelease

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for OsRelease

Source§

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

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

impl Default for OsRelease

Source§

fn default() -> OsRelease

Returns the “default value” for a type. Read more
Source§

impl Serialize for OsRelease

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToJson for OsRelease

Source§

fn to_json(&self) -> Result<String>
where Self: Serialize,

Convert object data to machine-readable JSON format (without unnecessary indentation and newline transitions)
Source§

fn to_json_pretty(&self) -> Result<String>
where Self: Serialize,

Convert object data to human-readable JSON format (“pretty”; with additional newline transitions and indentation)

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more