Struct LxVolumeOptions

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§

§

impl LxVolumeOptions

pub fn new() -> LxVolumeOptions

Create a new LxVolumeOptions with default options.

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

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

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

Creates a new LxVolume with the current options.

pub fn uid(&mut self, uid: u32) -> &mut LxVolumeOptions

Set the owner user ID for all files.

pub fn gid(&mut self, gid: u32) -> &mut LxVolumeOptions

Set the owner group ID for all files.

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

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

pub fn default_uid(&mut self, uid: u32) -> &mut LxVolumeOptions

Set the owner user ID for files without metadata.

pub fn default_gid(&mut self, gid: u32) -> &mut LxVolumeOptions

Set the owner group ID for files without metadata.

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

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

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

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

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

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

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

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.

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

Apply additional file restrictions.

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

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

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.

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

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/”.

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

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§

§

impl Clone for LxVolumeOptions

§

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
§

impl Default for LxVolumeOptions

§

fn default() -> LxVolumeOptions

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

§

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