Struct OpaqueSecurityContext

Source
pub struct OpaqueSecurityContext { /* private fields */ }
Expand description

Opaque security context.

Implementations§

Source§

impl OpaqueSecurityContext

Source

pub fn as_ptr(&self) -> *const context_s_t

Return the managed raw pointer to selinux_sys::context_s_t.

Source

pub fn as_mut_ptr(&mut self) -> *mut context_s_t

Return the managed raw pointer to selinux_sys::context_s_t.

Source

pub fn new(context: &str) -> Result<Self>

Return a new context initialized to a context string.

See: context_new().

Source

pub fn from_c_str(context: &CStr) -> Result<Self>

Return a new context initialized to a context string.

See: context_new().

Source

pub fn to_c_string(&self) -> Result<CString>

Return the string value of this security context.

See: context_str().

Source

pub fn the_type(&self) -> Result<CString>

Return the string value of this security context’s type.

See: context_type_get().

Source

pub fn set_type_str(&self, new_value: &str) -> Result<()>

Set the type of this security context.

See: context_type_set().

Source

pub fn set_type(&self, new_value: &CStr) -> Result<()>

Set the type of this security context.

See: context_type_set().

Source

pub fn range(&self) -> Result<CString>

Return the string value of this security context’s range.

See: context_range_get().

Source

pub fn set_range_str(&self, new_value: &str) -> Result<()>

Set the range of this security context.

See: context_range_set().

Source

pub fn set_range(&self, new_value: &CStr) -> Result<()>

Set the range of this security context.

See: context_range_set().

Source

pub fn role(&self) -> Result<CString>

Return the string value of this security context’s role.

See: context_role_get().

Source

pub fn set_role_str(&self, new_value: &str) -> Result<()>

Set the role of this security context.

See: context_role_set().

Source

pub fn set_role(&self, new_value: &CStr) -> Result<()>

Set the role of this security context.

See: context_role_set().

Source

pub fn user(&self) -> Result<CString>

Return the string value of this security context’s user.

See: context_user_get().

Source

pub fn set_user_str(&self, new_value: &str) -> Result<()>

Set the user of this security context.

See: context_user_set().

Source

pub fn set_user(&self, new_value: &CStr) -> Result<()>

Set the user of this security context.

See: context_user_set().

Trait Implementations§

Source§

impl Debug for OpaqueSecurityContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for OpaqueSecurityContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

See: context_str().

Source§

impl Drop for OpaqueSecurityContext

Source§

fn drop(&mut self)

See: context_free().

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.