pub struct Acl { /* private fields */ }
Implementations§
Source§impl Acl
impl Acl
pub fn init(count: i32) -> Result<Self, AclError>
pub fn from_text(text: &str) -> Result<Self, AclError>
pub fn to_text(&self) -> Result<Vec<u8>, AclError>
pub fn for_fd(fd: i32) -> Result<Self, AclError>
pub fn set_for_fd(&self, fd: i32) -> Result<(), AclError>
pub fn for_file(file_path: &PathBuf, typ: &AclType) -> Result<Self, AclError>
pub fn set_for_file( &self, file_path: &PathBuf, typ: &AclType, ) -> Result<(), AclError>
pub fn get_entry(&self, id: &EntryId) -> Result<Option<AclEntry>, AclError>
Sourcepub fn create_entry(&mut self) -> Result<AclEntry, AclError>
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.
Sourcepub fn delete_entry(
&mut self,
entry: AclEntry,
) -> Result<(), (AclEntry, AclError)>
pub fn delete_entry( &mut self, entry: AclEntry, ) -> Result<(), (AclEntry, AclError)>
consumes the entry but returns it if an error occurs
Sourcepub fn free(self) -> Result<(), (Self, AclError)>
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
pub fn calc_mask(&mut self) -> Result<(), AclError>
pub fn dup(&self) -> Result<Acl, AclError>
pub fn size(&self) -> Result<usize, AclError>
pub fn valid(&self) -> Result<Option<Errno>, AclError>
Trait Implementations§
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> 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