[−][src]Enum pathfix::config::IncludeAdministrative
Variants
Implementations
impl IncludeAdministrative
[src]
pub fn check_current_user(&self) -> Result<bool>
[src]
check_current_user
will check if the running users qualifies as an administrator.
The result will be used to includes path's which are marked as admin only.
Examples
use pathfix::config::IncludeAdministrative; assert_eq!(IncludeAdministrative::Always.check_current_user().unwrap(), true); assert_eq!(IncludeAdministrative::Never.check_current_user().unwrap(), false); assert_eq!( IncludeAdministrative::Users(vec!["thisuserdoesnotexist".to_string()]).check_current_user().unwrap(), false ); assert_eq!(IncludeAdministrative::RootOnly.check_current_user().unwrap(), users::get_current_uid() == 0);
Trait Implementations
impl Clone for IncludeAdministrative
[src]
fn clone(&self) -> IncludeAdministrative
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for IncludeAdministrative
[src]
impl Default for IncludeAdministrative
[src]
impl<'de> Deserialize<'de> for IncludeAdministrative
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for IncludeAdministrative
[src]
impl PartialEq<IncludeAdministrative> for IncludeAdministrative
[src]
fn eq(&self, other: &IncludeAdministrative) -> bool
[src]
fn ne(&self, other: &IncludeAdministrative) -> bool
[src]
impl Serialize for IncludeAdministrative
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for IncludeAdministrative
[src]
impl StructuralPartialEq for IncludeAdministrative
[src]
Auto Trait Implementations
impl RefUnwindSafe for IncludeAdministrative
impl Send for IncludeAdministrative
impl Sync for IncludeAdministrative
impl Unpin for IncludeAdministrative
impl UnwindSafe for IncludeAdministrative
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, 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>,