pub struct MakePkgOption {
name: String,
on: bool,
}
Expand description
An option string
The option string is identified by its name and whether it is on (not prefixed with “!”) or off (prefixed with “!”).
This type is used in the context of makepkg
options, build environment options (BuildEnv
),
and package options (PackageOption
).
§Examples
use alpm_types::MakePkgOption;
let option = MakePkgOption::new("foo").unwrap();
assert_eq!(option.on(), true);
assert_eq!(option.name(), "foo");
let not_option = MakePkgOption::new("!foo").unwrap();
assert_eq!(not_option.on(), false);
assert_eq!(not_option.name(), "foo");
Fields§
§name: String
§on: bool
Implementations§
Trait Implementations§
source§impl Clone for MakePkgOption
impl Clone for MakePkgOption
source§fn clone(&self) -> MakePkgOption
fn clone(&self) -> MakePkgOption
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 MakePkgOption
impl Debug for MakePkgOption
source§impl Display for MakePkgOption
impl Display for MakePkgOption
source§impl FromStr for MakePkgOption
impl FromStr for MakePkgOption
source§impl PartialEq for MakePkgOption
impl PartialEq for MakePkgOption
impl Eq for MakePkgOption
impl StructuralPartialEq for MakePkgOption
Auto Trait Implementations§
impl Freeze for MakePkgOption
impl RefUnwindSafe for MakePkgOption
impl Send for MakePkgOption
impl Sync for MakePkgOption
impl Unpin for MakePkgOption
impl UnwindSafe for MakePkgOption
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)