Struct capabilities::Capabilities
[−]
[src]
pub struct Capabilities { /* fields omitted */ }
A capability set that can be manipulated.
Methods
impl Capabilities
[src]
fn new() -> Option<Capabilities>
Create a new empty capability set
fn from_fd(fd: isize) -> Option<Capabilities>
Create a capability set from the specified file descriptor
fn from_file(path: &str) -> Option<Capabilities>
Create a capability set base on the supplied file path
fn from_pid(pid: isize) -> Option<Capabilities>
Create a capability set from the supplied process ID.
fn from_current_proc() -> Option<Capabilities>
Create a capability set based on the current processes capabilities.
fn reset_all(&mut self)
Clear all the entries in the capability set.
fn reset_flag(&mut self, flag: Flag)
Clear all instances of the supplied flag.
fn check(&self, cap: Capability, flag: Flag) -> bool
Check if the supplied capability has the flag set in this capability set.
fn update(&mut self, caps: &[Capability], flag: Flag, set: bool) -> bool
Update the capability set adding the supplied capabilities. Each of the supplied capabilities will have the flag set or cleared depending on the value supplied for set.
fn apply(&self) -> Result<(), Error>
Attempt to apply the capability set to the current process.
fn apply_to_fd(&self, fd: i32) -> Result<(), Error>
Attempt to apply the capability set to the supplied file descriptor.
fn apply_to_file(&self, path: &str) -> Result<(), Error>
Attempt to apply the capability set to the supplied file.
Trait Implementations
impl Drop for Capabilities
[src]
impl Clone for Capabilities
[src]
fn clone(&self) -> Capabilities
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Capabilities
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Eq for Capabilities
[src]
impl FromStr for Capabilities
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Capabilities, ()>
Parses a string s
to return a value of this type. Read more