Skip to main content

SetAttrsOp

Struct SetAttrsOp 

Source
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>

Source

pub fn new(target: T) -> SetAttrsOp<T>

Prepare an update, following the final symlink for path targets.

Follow the final path symlink when true, or modify the link itself when false. Opened objects retain their identity regardless of this setting.

Source

pub fn target(&self) -> &T

The path or opened-object operand.

Source

pub fn permissions(self, permissions: Permissions) -> SetAttrsOp<T>

Change permissions, leaving other unspecified attributes unchanged.

Source

pub fn uid(self, uid: u32) -> SetAttrsOp<T>

Change the owner. u32::MAX is reserved and rejected before dispatch.

Source

pub fn gid(self, gid: u32) -> SetAttrsOp<T>

Change the group. u32::MAX is reserved and rejected before dispatch.

Source

pub fn len(self, len: u64) -> SetAttrsOp<T>

Truncate or extend the file. Zero explicitly truncates it to an empty file.

Source

pub fn accessed(self, accessed: SystemTime) -> SetAttrsOp<T>

Set the access timestamp.

Source

pub fn modified(self, modified: SystemTime) -> SetAttrsOp<T>

Set the modification timestamp.

Source

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.

Source

pub fn requested_permissions(&self) -> Option<Permissions>

Requested permission change, or None to leave permissions unchanged.

Source

pub fn requested_uid(&self) -> Option<u32>

Requested owner change, or None to leave the owner unchanged.

Source

pub fn requested_gid(&self) -> Option<u32>

Requested group change, or None to leave the group unchanged.

Source

pub fn requested_len(&self) -> Option<u64>

Requested length, including zero, or None to leave the length unchanged.

Source

pub fn requested_accessed(&self) -> Option<SystemTime>

Requested access timestamp, or None to leave it unchanged.

Source

pub fn requested_modified(&self) -> Option<SystemTime>

Requested modification timestamp, or None to leave it unchanged.

Whether the final path symlink is followed.

Source§

impl<'a, F> SetAttrsOp<Target<'a, F>>

Source

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,

Source§

fn clone(&self) -> SetAttrsOp<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for SetAttrsOp<T>
where T: Copy,

Source§

impl<T> Debug for SetAttrsOp<T>
where T: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SetAttrsOp<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for SetAttrsOp<T>
where T: RefUnwindSafe,

§

impl<T> Send for SetAttrsOp<T>
where T: Send,

§

impl<T> Sync for SetAttrsOp<T>
where T: Sync,

§

impl<T> Unpin for SetAttrsOp<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for SetAttrsOp<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for SetAttrsOp<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.