[−][src]Enum rctl::Subject
A struct representing an RCTL subject.
From rctl(8)
:
Subject defines the kind of entity the rule applies to. It can be either process, user, login class, or jail.
Subject ID identifies the subject. It can be user name, numerical user ID login class name, or jail name.
Variants
Implementations
impl Subject
[src]
pub fn process_id(pid: pid_t) -> Self
[src]
pub fn user_name(name: &str) -> Result<Self, ParseError>
[src]
pub fn user_id(uid: uid_t) -> Self
[src]
pub fn login_class<S: Into<String>>(name: S) -> Self
[src]
pub fn jail_name<S: Into<String>>(name: S) -> Self
[src]
pub fn usage(&self) -> Result<HashMap<Resource, usize>, Error>
[src]
Get the resource usage for a specific [Subject].
Example
extern crate libc; let uid = unsafe { libc::getuid() }; let subject = rctl::Subject::user_id(uid); let usage = subject.usage() .expect("Could not get RCTL usage"); println!("{:#?}", usage);
pub fn limits(&self) -> Result<RuleParsingIntoIter<String>, Error>
[src]
Get an IntoIterator over the rules that apply to this subject.
Trait Implementations
impl Clone for Subject
[src]
impl Debug for Subject
[src]
impl Display for Subject
[src]
impl Eq for Subject
[src]
impl<'a> From<&'a Subject> for SubjectType
[src]
impl<'a> From<&'a Subject> for Filter
[src]
impl From<Subject> for Filter
[src]
impl FromStr for Subject
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Subject
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> Into<String> for &'a Subject
[src]
impl PartialEq<Subject> for Subject
[src]
impl StructuralEq for Subject
[src]
impl StructuralPartialEq for Subject
[src]
Auto Trait Implementations
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnwindSafe for Subject
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> 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>,