Type Alias BuildEnvironmentOption

Source
pub type BuildEnvironmentOption = MakepkgOption;
Expand description

An option string used in a build environment

The option string is identified by its name and whether it is on (not prefixed with “!”) or off (prefixed with “!”). This type is an alias for MakepkgOption.

§Examples

use alpm_types::BuildEnvironmentOption;

let option = BuildEnvironmentOption::new("foo")?;
assert_eq!(option.on(), true);
assert_eq!(option.name(), "foo");

let not_option = BuildEnvironmentOption::new("!foo")?;
assert_eq!(not_option.on(), false);
assert_eq!(not_option.name(), "foo");

Aliased Type§

struct BuildEnvironmentOption {
    name: String,
    on: bool,
}

Fields§

§name: String§on: bool

Implementations

Source§

impl MakepkgOption

Source

pub fn new(option: &str) -> Result<Self, Error>

Create a new MakepkgOption in a Result

Source

pub fn name(&self) -> &str

Get the name of the MakepkgOption

Source

pub fn on(&self) -> bool

Get whether the MakepkgOption is on

Trait Implementations

Source§

impl Clone for MakepkgOption

Source§

fn clone(&self) -> MakepkgOption

Returns a copy 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 MakepkgOption

Source§

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

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

impl<'de> Deserialize<'de> for MakepkgOption

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for MakepkgOption

Source§

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

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

impl FromStr for MakepkgOption

Source§

fn from_str(s: &str) -> Result<MakepkgOption, Self::Err>

Create an Option from a string

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl PartialEq for MakepkgOption

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MakepkgOption

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 Eq for MakepkgOption

Source§

impl StructuralPartialEq for MakepkgOption