pub enum ACLError {
IoError(IoErrorDetail),
ValidationError(ValidationErrorDetail),
}
Expand description
Error type from ACL operations. To distinguish different causes, use the kind()
method.
Variants§
IoError(IoErrorDetail)
Filesystem error while reading or writing ACL (file not found, permission denied, etc).
ValidationError(ValidationErrorDetail)
ACL is not valid and cannot be written.
Unfortunately it is not possible to provide detailed reasons, but mainly it can mean:
- Required entries are missing (
UserObj
,GroupObj
,Mask
andOther
). - ACL contains entries that are not unique.
Implementations§
Source§impl ACLError
impl ACLError
Sourcepub fn kind(&self) -> ErrorKind
pub fn kind(&self) -> ErrorKind
Get a general category of error, as std::io::ErrorKind
.
Validation errors get returned as InvalidData
.
use posix_acl::PosixACL;
use std::io::ErrorKind;
let err = PosixACL::read_acl("/tmp/this-file-does-not-exist").unwrap_err();
assert_eq!(err.kind(), ErrorKind::NotFound);
Sourcepub fn as_io_error(&self) -> Option<&Error>
pub fn as_io_error(&self) -> Option<&Error>
Get reference to underlying std::io::Error
that occurred, if any.
use posix_acl::PosixACL;
use std::io::ErrorKind;
let err = PosixACL::read_acl("/tmp/this-file-does-not-exist").unwrap_err();
assert_eq!(err.as_io_error().unwrap().raw_os_error().unwrap(), libc::ENOENT);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ACLError
impl !RefUnwindSafe for ACLError
impl Send for ACLError
impl Sync for ACLError
impl Unpin for ACLError
impl !UnwindSafe for ACLError
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