pub struct SetAttrsOp<T> { /* private fields */ }Expand description
One attribute update for a path or opened object.
Paths can be supplied directly. Use super::Target for handles
or mixed path/handle batches. Unspecified fields are unchanged; construction
performs no I/O. Final symlinks are followed by default.
Implementations§
Source§impl<T> SetAttrsOp<T>
impl<T> SetAttrsOp<T>
Sourcepub fn new(target: T) -> SetAttrsOp<T>
pub fn new(target: T) -> SetAttrsOp<T>
Prepare an update, following the final symlink for path targets.
Sourcepub fn follow_symlinks(self, follow: bool) -> SetAttrsOp<T>
pub fn follow_symlinks(self, follow: bool) -> SetAttrsOp<T>
Follow the final path symlink when true, or modify the link itself when false. Opened objects retain their identity regardless of this setting.
Sourcepub fn permissions(self, permissions: Permissions) -> SetAttrsOp<T>
pub fn permissions(self, permissions: Permissions) -> SetAttrsOp<T>
Change permissions, leaving other unspecified attributes unchanged.
Sourcepub fn uid(self, uid: u32) -> SetAttrsOp<T>
pub fn uid(self, uid: u32) -> SetAttrsOp<T>
Change the owner. u32::MAX is reserved and rejected before dispatch.
Sourcepub fn gid(self, gid: u32) -> SetAttrsOp<T>
pub fn gid(self, gid: u32) -> SetAttrsOp<T>
Change the group. u32::MAX is reserved and rejected before dispatch.
Sourcepub fn len(self, len: u64) -> SetAttrsOp<T>
pub fn len(self, len: u64) -> SetAttrsOp<T>
Truncate or extend the file. Zero explicitly truncates it to an empty file.
Sourcepub fn accessed(self, accessed: SystemTime) -> SetAttrsOp<T>
pub fn accessed(self, accessed: SystemTime) -> SetAttrsOp<T>
Set the access timestamp.
Sourcepub fn modified(self, modified: SystemTime) -> SetAttrsOp<T>
pub fn modified(self, modified: SystemTime) -> SetAttrsOp<T>
Set the modification timestamp.
Sourcepub fn with_target<U>(&self, target: U) -> SetAttrsOp<U>
pub fn with_target<U>(&self, target: U) -> SetAttrsOp<U>
Reuse all requested changes and the symlink policy with another target. This constructs an operation without I/O or cloning the original target.
Sourcepub fn requested_permissions(&self) -> Option<Permissions>
pub fn requested_permissions(&self) -> Option<Permissions>
Requested permission change, or None to leave permissions unchanged.
Sourcepub fn requested_uid(&self) -> Option<u32>
pub fn requested_uid(&self) -> Option<u32>
Requested owner change, or None to leave the owner unchanged.
Sourcepub fn requested_gid(&self) -> Option<u32>
pub fn requested_gid(&self) -> Option<u32>
Requested group change, or None to leave the group unchanged.
Sourcepub fn requested_len(&self) -> Option<u64>
pub fn requested_len(&self) -> Option<u64>
Requested length, including zero, or None to leave the length unchanged.
Sourcepub fn requested_accessed(&self) -> Option<SystemTime>
pub fn requested_accessed(&self) -> Option<SystemTime>
Requested access timestamp, or None to leave it unchanged.
Sourcepub fn requested_modified(&self) -> Option<SystemTime>
pub fn requested_modified(&self) -> Option<SystemTime>
Requested modification timestamp, or None to leave it unchanged.
Sourcepub fn follows_symlinks(&self) -> bool
pub fn follows_symlinks(&self) -> bool
Whether the final path symlink is followed.
Source§impl<'a, F> SetAttrsOp<Target<'a, F>>
impl<'a, F> SetAttrsOp<Target<'a, F>>
Sourcepub fn file(file: &'a F) -> SetAttrsOp<Target<'a, F>>
pub fn file(file: &'a F) -> SetAttrsOp<Target<'a, F>>
Prepare an update for an opened object without borrowing its pathname. The handle remains owned by the caller and is checked at dispatch.
use vfsi_core::api::{SetAttrsOp, Vfsi};
fs.vsetattrs(&[SetAttrsOp::file(file).len(1024)])?;Trait Implementations§
Source§impl<T> Clone for SetAttrsOp<T>where
T: Clone,
impl<T> Clone for SetAttrsOp<T>where
T: Clone,
Source§fn clone(&self) -> SetAttrsOp<T>
fn clone(&self) -> SetAttrsOp<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more