lxutil

Struct LxVolumeOptions

Source
pub struct LxVolumeOptions { /* private fields */ }
Expand description

Sets options used by an LxVolume. These control whether metadata is enabled, and set defaults to use for files without metadata.

§Unix

These options have no effect on Unix platforms.

Implementations§

Source§

impl LxVolumeOptions

Source

pub fn new() -> Self

Create a new LxVolumeOptions with default options.

Source

pub fn from_option_string(option_string: &str) -> Self

Create a new ‘LxVolumeOptions’ using a semi-colon separated list of options of the form uid=1000;gid=1000;symlinkroot=/mnt/

Source

pub fn new_volume(&self, root_path: impl AsRef<Path>) -> Result<LxVolume>

Creates a new LxVolume with the current options.

Source

pub fn uid(&mut self, uid: uid_t) -> &mut Self

Set the owner user ID for all files.

Source

pub fn gid(&mut self, gid: gid_t) -> &mut Self

Set the owner group ID for all files.

Source

pub fn mode(&mut self, mode: u32) -> &mut Self

Sets the mode bits for all files. Directories will add ‘x’ automatically if ‘r’ is set to allow list.

Source

pub fn default_uid(&mut self, uid: uid_t) -> &mut Self

Set the owner user ID for files without metadata.

Source

pub fn default_gid(&mut self, gid: gid_t) -> &mut Self

Set the owner group ID for files without metadata.

Source

pub fn umask(&mut self, umask: u32) -> &mut Self

Set a mask of mode bits that will always be disabled on files and directories that have no metadata.

Source

pub fn fmask(&mut self, fmask: u32) -> &mut Self

Set a mask of mode bits that will always be disabled on files that have no metadata.

Source

pub fn dmask(&mut self, dmask: u32) -> &mut Self

Set a mask of mode bits that will always be disabled on directories that have no metadata.

Source

pub fn metadata(&mut self, metadata: bool) -> &mut Self

Enable or disable metadata for the volume.

This will be ignored if the underlying file system does not support the required features to emulate Linux attributes on Windows.

Source

pub fn sandbox(&mut self, enabled: bool) -> &mut Self

Apply additional file restrictions.

Hide files and directories that are marked as hidden or may cause hydration (e.g. OneDrive backed).

Source

pub fn sandbox_disallowed_extensions( &mut self, disallowed_extensions: Vec<&str>, ) -> &mut Self

Exclude specific file extensions when sandbox mode is enabled.

Hide files and directories with specific file extensions. Do not allow creation of new files with these extensions.

Source

pub fn create_case_sensitive_dirs( &mut self, create_case_sensitive_dirs: bool, ) -> &mut Self

Enable or disable whether new directories are created as case sensitive.

This will be ignored if the underlying file system does not support case sensitive directories.

This does not affect the behavior of existing case sensitive directories, where operations will be case sensitive and new directories will inherit the flag.

Set the root used to translate absolute Windows symlinks paths.

EXAMPLE: A symlink to C:\my\target will return /mnt/c/my/target if symlink_root is set to “/mnt/”.

Source

pub fn override_xattr(&mut self, name: &str, val: &[u8]) -> &mut Self

Add an extended attribute to return with every file in the volume.

This will be used in place of any actual extended attributes associated with the file.

N.B. Since some attributes may be related, replacing the returned attributes is deemed easier and safer than trying to union overrides with existing attributes.

Trait Implementations§

Source§

impl Clone for LxVolumeOptions

Source§

fn clone(&self) -> LxVolumeOptions

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for LxVolumeOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more