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
impl LxVolumeOptions
pub fn new() -> LxVolumeOptions
pub fn new() -> LxVolumeOptions
Create a new LxVolumeOptions
with default options.
pub fn from_option_string(option_string: &str) -> LxVolumeOptions
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>
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
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
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
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
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
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
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
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
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
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
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
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
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.
pub fn symlink_root(&mut self, symlink_root: &str) -> &mut LxVolumeOptions
pub fn symlink_root(&mut self, symlink_root: &str) -> &mut LxVolumeOptions
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
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
impl Clone for LxVolumeOptions
§fn clone(&self) -> LxVolumeOptions
fn clone(&self) -> LxVolumeOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more