pub enum PackageOption {
AutoDeps(bool),
Debug(bool),
Docs(bool),
EmptyDirs(bool),
Libtool(bool),
Lto(bool),
PEStrip(bool),
Purge(bool),
StaticLibs(bool),
Strip(bool),
Zipman(bool),
}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 “!”).
See the makepkg.conf manpage for more information.
§Examples
use alpm_types::PackageOption;
let option = PackageOption::new("debug")?;
assert_eq!(option.on(), true);
assert_eq!(option.name(), "debug");
let not_option = PackageOption::new("!lto")?;
assert_eq!(not_option.on(), false);
assert_eq!(not_option.name(), "lto");Variants§
AutoDeps(bool)
Automatically add dependencies and provisions (see alpm-sonamev2).
Debug(bool)
Add debugging flags as specified in DEBUG_* variables
Docs(bool)
Save doc directories specified by DOC_DIRS
EmptyDirs(bool)
Leave empty directories in packages
Libtool(bool)
Leave libtool (.la) files in packages
Lto(bool)
Add compile flags for building with link time optimization
PEStrip(bool)
Strip debug symbols from Portable Executable (PE) format files
Purge(bool)
Remove files specified by PURGE_TARGETS
StaticLibs(bool)
Leave static library (.a) files in packages
Strip(bool)
Strip symbols from binaries/libraries
Zipman(bool)
Compress manual (man and info) pages in MAN_DIRS with gzip
Implementations§
Source§impl PackageOption
impl PackageOption
Sourcepub fn new(option: &str) -> Result<Self, Error>
pub fn new(option: &str) -> Result<Self, Error>
Creates a new PackageOption from a string slice.
§Errors
An error is returned if the string slice does not match a valid package option.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of the PackageOption as string slice.
Sourcepub fn on(&self) -> bool
pub fn on(&self) -> bool
Returns whether the PackageOption is on or off.
Trait Implementations§
Source§impl AlpmParser for PackageOption
impl AlpmParser for PackageOption
Source§fn parser(input: &mut &str) -> ModalResult<Self>
fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a PackageOption in a string slice.
§Errors
Returns an error if input does not begin with a valid PackageOption.
Source§impl Clone for PackageOption
impl Clone for PackageOption
Source§fn clone(&self) -> PackageOption
fn clone(&self) -> PackageOption
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackageOption
impl Debug for PackageOption
Source§impl<'de> Deserialize<'de> for PackageOption
impl<'de> Deserialize<'de> for PackageOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for PackageOption
impl Display for PackageOption
Source§impl FromStr for PackageOption
impl FromStr for PackageOption
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a PackageOption from a string slice.
Delegates to PackageOption::parser.
§Errors
Returns an error if PackageOption::parser fails.
Source§impl PartialEq for PackageOption
impl PartialEq for PackageOption
Source§fn eq(&self, other: &PackageOption) -> bool
fn eq(&self, other: &PackageOption) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PackageOption
impl Serialize for PackageOption
Source§impl VariantNames for PackageOption
impl VariantNames for PackageOption
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 UnsafeUnpin for PackageOption
impl UnwindSafe for PackageOption
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U> ParserUntil for Uwhere
U: AlpmParser,
impl<U> ParserUntil for Uwhere
U: AlpmParser,
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
§Note
Does not consume the delimiter.
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Source§impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
Source§fn parser_until_inclusive<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.