Struct Acl

Source
pub struct Acl { /* private fields */ }

Implementations§

Source§

impl Acl

Source

pub fn init(count: i32) -> Result<Self, AclError>

Source

pub fn from_text(text: &str) -> Result<Self, AclError>

Source

pub fn to_text(&self) -> Result<Vec<u8>, AclError>

Source

pub fn for_fd(fd: i32) -> Result<Self, AclError>

Source

pub fn set_for_fd(&self, fd: i32) -> Result<(), AclError>

Source

pub fn for_file(file_path: &PathBuf, typ: &AclType) -> Result<Self, AclError>

Source

pub fn set_for_file( &self, file_path: &PathBuf, typ: &AclType, ) -> Result<(), AclError>

Source

pub fn get_entry(&self, id: &EntryId) -> Result<Option<AclEntry>, AclError>

Source

pub fn create_entry(&mut self) -> Result<AclEntry, AclError>

This is dangerous. The lifetime of all permsets and entries is bound to the liftime of the Acls raw_pointer. Since this operation might move the Acl to a bigger allocation this might introduce unsoundness.

This should be prevented since we check in each call if is_valid is still true but it is pretty hacky.

Source

pub fn delete_entry( &mut self, entry: AclEntry, ) -> Result<(), (AclEntry, AclError)>

consumes the entry but returns it if an error occurs

Source

pub fn free(self) -> Result<(), (Self, AclError)>

Use with care. Acl may not be used after this. This will also be called when dropped so maybe just let drop handle this

Source

pub fn calc_mask(&mut self) -> Result<(), AclError>

Source

pub fn dup(&self) -> Result<Acl, AclError>

Source

pub fn size(&self) -> Result<usize, AclError>

Source

pub fn valid(&self) -> Result<Option<Errno>, AclError>

Trait Implementations§

Source§

impl Debug for Acl

Source§

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

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

impl Drop for Acl

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Acl

§

impl !RefUnwindSafe for Acl

§

impl !Send for Acl

§

impl !Sync for Acl

§

impl Unpin for Acl

§

impl !UnwindSafe for Acl

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, 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.