[−][src]Struct pathfix::config::PathFlags
Flags for a Path
PathFlags
describes the requirements that the system must fulfill
so that the Path
will be included to the $PATH string.
Examples
Parse the PathFlags
and check the current system.
use pathfix::config::{PathFlags, IncludeAdministrative}; let flags: PathFlags = "admin".parse().unwrap(); assert!(flags.check(PathFlags::this_system(&IncludeAdministrative::Always)));
Implementations
impl PathFlags
[src]
pub fn new() -> PathFlags
[src]
Creates empty PathFlags without any requirements.
Examples
use pathfix::config::PathFlags; println!("{}", PathFlags::new());
pub fn check(self, given: PathFlags) -> bool
[src]
Checks if the PathFlags
are given for the flags of the given system.
Example
Check if default flags are met.
use pathfix::config::{PathFlags, IncludeAdministrative}; assert!( PathFlags::new().check( PathFlags::this_system(&IncludeAdministrative::Always) ) );
pub fn this_system<I>(include_administrative: &I) -> PathFlags where
I: Borrow<IncludeAdministrative>,
[src]
I: Borrow<IncludeAdministrative>,
Get given PathFlags
for this system.
Example
Test if current system is Linux.
use pathfix::config::{PathFlags, IncludeAdministrative}; let requirements: PathFlags = "linux".parse().unwrap(); let this_system = PathFlags::this_system(&IncludeAdministrative::Always); assert_eq!(requirements.check(this_system), cfg!(target_os = "linux"));
Trait Implementations
impl Clone for PathFlags
[src]
impl Copy for PathFlags
[src]
impl Debug for PathFlags
[src]
impl Default for PathFlags
[src]
impl<'de> Deserialize<'de> for PathFlags
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for PathFlags
[src]
impl Eq for PathFlags
[src]
impl FromStr for PathFlags
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Ord for PathFlags
[src]
fn cmp(&self, other: &PathFlags) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PathFlags> for PathFlags
[src]
impl PartialOrd<PathFlags> for PathFlags
[src]
fn partial_cmp(&self, other: &PathFlags) -> Option<Ordering>
[src]
fn lt(&self, other: &PathFlags) -> bool
[src]
fn le(&self, other: &PathFlags) -> bool
[src]
fn gt(&self, other: &PathFlags) -> bool
[src]
fn ge(&self, other: &PathFlags) -> bool
[src]
impl Serialize for PathFlags
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl StructuralEq for PathFlags
[src]
impl StructuralPartialEq for PathFlags
[src]
Auto Trait Implementations
impl RefUnwindSafe for PathFlags
impl Send for PathFlags
impl Sync for PathFlags
impl Unpin for PathFlags
impl UnwindSafe for PathFlags
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,