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
impl LxVolumeOptions
Sourcepub fn from_option_string(option_string: &str) -> Self
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/
Sourcepub fn new_volume(&self, root_path: impl AsRef<Path>) -> Result<LxVolume>
pub fn new_volume(&self, root_path: impl AsRef<Path>) -> Result<LxVolume>
Creates a new LxVolume
with the current options.
Sourcepub fn mode(&mut self, mode: u32) -> &mut Self
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.
Sourcepub fn default_uid(&mut self, uid: uid_t) -> &mut Self
pub fn default_uid(&mut self, uid: uid_t) -> &mut Self
Set the owner user ID for files without metadata.
Sourcepub fn default_gid(&mut self, gid: gid_t) -> &mut Self
pub fn default_gid(&mut self, gid: gid_t) -> &mut Self
Set the owner group ID for files without metadata.
Sourcepub fn umask(&mut self, umask: u32) -> &mut Self
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.
Sourcepub fn fmask(&mut self, fmask: u32) -> &mut Self
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.
Sourcepub fn dmask(&mut self, dmask: u32) -> &mut Self
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.
Sourcepub fn metadata(&mut self, metadata: bool) -> &mut Self
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.
Sourcepub fn sandbox(&mut self, enabled: bool) -> &mut Self
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).
Sourcepub fn sandbox_disallowed_extensions(
&mut self,
disallowed_extensions: Vec<&str>,
) -> &mut Self
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.
Sourcepub fn create_case_sensitive_dirs(
&mut self,
create_case_sensitive_dirs: bool,
) -> &mut Self
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.
Sourcepub fn symlink_root(&mut self, symlink_root: &str) -> &mut Self
pub fn symlink_root(&mut self, symlink_root: &str) -> &mut Self
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/”.
Sourcepub fn override_xattr(&mut self, name: &str, val: &[u8]) -> &mut Self
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
impl Clone for LxVolumeOptions
Source§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