Struct capctl::caps::FullCapState
source · #[non_exhaustive]pub struct FullCapState {
pub permitted: CapSet,
pub effective: CapSet,
pub inheritable: CapSet,
pub ambient: CapSet,
pub bounding: CapSet,
pub no_new_privs: bool,
}Expand description
Represents the “full” capability state of a thread (i.e. the contents of all 5 capability sets and some additional information).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.permitted: CapSet§effective: CapSet§inheritable: CapSet§ambient: CapSet§bounding: CapSet§no_new_privs: boolImplementations§
source§impl FullCapState
impl FullCapState
sourcepub fn get_current() -> Result<Self>
pub fn get_current() -> Result<Self>
Get the full capability state of the current thread.
This is equivalent to FullCapState::get_for_pid(0). However, this method uses the kernel
APIs to retrieve information instead of examining files in /proc.
sourcepub fn get_for_pid(pid: pid_t) -> Result<Self>
pub fn get_for_pid(pid: pid_t) -> Result<Self>
Get the full capability state of the process (or thread) with the given PID (or TID) by
examining special files in /proc.
If pid is 0, this method gets the capability state of the current thread.
Trait Implementations§
source§impl Clone for FullCapState
impl Clone for FullCapState
source§fn clone(&self) -> FullCapState
fn clone(&self) -> FullCapState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for FullCapState
impl Debug for FullCapState
source§impl<'de> Deserialize<'de> for FullCapState
impl<'de> Deserialize<'de> for FullCapState
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for FullCapState
impl Hash for FullCapState
source§impl PartialEq<FullCapState> for FullCapState
impl PartialEq<FullCapState> for FullCapState
source§fn eq(&self, other: &FullCapState) -> bool
fn eq(&self, other: &FullCapState) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for FullCapState
impl Serialize for FullCapState
impl Copy for FullCapState
impl Eq for FullCapState
impl StructuralEq for FullCapState
impl StructuralPartialEq for FullCapState
Auto Trait Implementations§
impl RefUnwindSafe for FullCapState
impl Send for FullCapState
impl Sync for FullCapState
impl Unpin for FullCapState
impl UnwindSafe for FullCapState
Blanket Implementations§
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
Mutably borrows from an owned value. Read more