pub trait FileExt: AsRawFd {
// Provided methods
fn get_xattr<N>(&self, name: N) -> Result<Option<Vec<u8>>>
where N: AsRef<OsStr> { ... }
fn set_xattr<N>(&self, name: N, value: &[u8]) -> Result<()>
where N: AsRef<OsStr> { ... }
fn remove_xattr<N>(&self, name: N) -> Result<()>
where N: AsRef<OsStr> { ... }
fn list_xattr(&self) -> Result<XAttrs> { ... }
}
Expand description
Extension trait to manipulate extended attributes on File
-like objects.
Provided Methods§
Sourcefn get_xattr<N>(&self, name: N) -> Result<Option<Vec<u8>>>
fn get_xattr<N>(&self, name: N) -> Result<Option<Vec<u8>>>
Get an extended attribute for the specified file.
Sourcefn set_xattr<N>(&self, name: N, value: &[u8]) -> Result<()>
fn set_xattr<N>(&self, name: N, value: &[u8]) -> Result<()>
Set an extended attribute on the specified file.
Sourcefn remove_xattr<N>(&self, name: N) -> Result<()>
fn remove_xattr<N>(&self, name: N) -> Result<()>
Remove an extended attribute from the specified file.
Sourcefn list_xattr(&self) -> Result<XAttrs>
fn list_xattr(&self) -> Result<XAttrs>
List extended attributes attached to the specified file.
Note: this may not list all attributes. Speficially, it definitely won’t list any trusted attributes unless you are root and it may not list system attributes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.