Struct alpm_types::PackageOption
source · pub struct PackageOption(BuildOption);
Expand description
An option string used in packaging
The option string is identified by its name and whether it is on (not prefixed with “!”) or off (prefixed with “!”).
This type dereferences to BuildOption
.
§Examples
use alpm_types::PackageOption;
let option = PackageOption::new("foo").unwrap();
assert_eq!(option.on(), true);
assert_eq!(option.name(), "foo");
let not_option = PackageOption::new("!foo").unwrap();
assert_eq!(not_option.on(), false);
assert_eq!(not_option.name(), "foo");
Tuple Fields§
§0: BuildOption
Implementations§
source§impl PackageOption
impl PackageOption
sourcepub fn inner(&self) -> &BuildOption
pub fn inner(&self) -> &BuildOption
Return a reference to the inner type
Trait Implementations§
source§impl Clone for PackageOption
impl Clone for PackageOption
source§fn clone(&self) -> PackageOption
fn clone(&self) -> PackageOption
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PackageOption
impl Debug for PackageOption
source§impl Display for PackageOption
impl Display for PackageOption
source§impl FromStr for PackageOption
impl FromStr for PackageOption
source§impl PartialEq for PackageOption
impl PartialEq for PackageOption
source§fn eq(&self, other: &PackageOption) -> bool
fn eq(&self, other: &PackageOption) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PackageOption
impl StructuralPartialEq for PackageOption
Auto Trait Implementations§
impl Freeze for PackageOption
impl RefUnwindSafe for PackageOption
impl Send for PackageOption
impl Sync for PackageOption
impl Unpin for PackageOption
impl UnwindSafe for PackageOption
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more