pub struct Mount { /* private fields */ }Expand description
Mount specifies a mount for a container.
Implementations§
Source§impl Mount
impl Mount
Sourcepub fn destination(&self) -> &PathBuf
pub fn destination(&self) -> &PathBuf
Destination is the absolute path where the mount will be placed in the container.
Sourcepub fn uid_mappings(&self) -> &Option<Vec<LinuxIdMapping>>
pub fn uid_mappings(&self) -> &Option<Vec<LinuxIdMapping>>
UID mappings for ID-mapped mounts (Linux 5.12+).
Specifies how to map UIDs from the source filesystem to the destination mount point.
This allows changing file ownership without calling chown.
Important: If specified, gid_mappings MUST also be specified.
The mount options SHOULD include “idmap” or “ridmap”.
See: https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-mounts
Sourcepub fn gid_mappings(&self) -> &Option<Vec<LinuxIdMapping>>
pub fn gid_mappings(&self) -> &Option<Vec<LinuxIdMapping>>
GID mappings for ID-mapped mounts (Linux 5.12+).
Specifies how to map GIDs from the source filesystem to the destination mount point. This allows changing file group ownership without calling chown.
Important: If specified, uid_mappings MUST also be specified.
The mount options SHOULD include "idmap" or "ridmap".
See: https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-mounts
Source§impl Mount
impl Mount
Sourcepub fn destination_mut(&mut self) -> &mut PathBuf
pub fn destination_mut(&mut self) -> &mut PathBuf
Destination is the absolute path where the mount will be placed in the container.
Sourcepub fn source_mut(&mut self) -> &mut Option<PathBuf>
pub fn source_mut(&mut self) -> &mut Option<PathBuf>
Source specifies the source path of the mount.
Sourcepub fn options_mut(&mut self) -> &mut Option<Vec<String>>
pub fn options_mut(&mut self) -> &mut Option<Vec<String>>
Options are fstab style mount options.
Sourcepub fn uid_mappings_mut(&mut self) -> &mut Option<Vec<LinuxIdMapping>>
pub fn uid_mappings_mut(&mut self) -> &mut Option<Vec<LinuxIdMapping>>
UID mappings for ID-mapped mounts (Linux 5.12+).
Specifies how to map UIDs from the source filesystem to the destination mount point.
This allows changing file ownership without calling chown.
Important: If specified, gid_mappings MUST also be specified.
The mount options SHOULD include “idmap” or “ridmap”.
See: https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-mounts
Sourcepub fn gid_mappings_mut(&mut self) -> &mut Option<Vec<LinuxIdMapping>>
pub fn gid_mappings_mut(&mut self) -> &mut Option<Vec<LinuxIdMapping>>
GID mappings for ID-mapped mounts (Linux 5.12+).
Specifies how to map GIDs from the source filesystem to the destination mount point. This allows changing file group ownership without calling chown.
Important: If specified, uid_mappings MUST also be specified.
The mount options SHOULD include "idmap" or "ridmap".
See: https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-mounts
Source§impl Mount
impl Mount
Sourcepub fn set_destination(&mut self, val: PathBuf) -> &mut Self
pub fn set_destination(&mut self, val: PathBuf) -> &mut Self
Destination is the absolute path where the mount will be placed in the container.
Sourcepub fn set_source(&mut self, val: Option<PathBuf>) -> &mut Self
pub fn set_source(&mut self, val: Option<PathBuf>) -> &mut Self
Source specifies the source path of the mount.
Sourcepub fn set_options(&mut self, val: Option<Vec<String>>) -> &mut Self
pub fn set_options(&mut self, val: Option<Vec<String>>) -> &mut Self
Options are fstab style mount options.
Sourcepub fn set_uid_mappings(
&mut self,
val: Option<Vec<LinuxIdMapping>>,
) -> &mut Self
pub fn set_uid_mappings( &mut self, val: Option<Vec<LinuxIdMapping>>, ) -> &mut Self
UID mappings for ID-mapped mounts (Linux 5.12+).
Specifies how to map UIDs from the source filesystem to the destination mount point.
This allows changing file ownership without calling chown.
Important: If specified, gid_mappings MUST also be specified.
The mount options SHOULD include “idmap” or “ridmap”.
See: https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-mounts
Sourcepub fn set_gid_mappings(
&mut self,
val: Option<Vec<LinuxIdMapping>>,
) -> &mut Self
pub fn set_gid_mappings( &mut self, val: Option<Vec<LinuxIdMapping>>, ) -> &mut Self
GID mappings for ID-mapped mounts (Linux 5.12+).
Specifies how to map GIDs from the source filesystem to the destination mount point. This allows changing file group ownership without calling chown.
Important: If specified, uid_mappings MUST also be specified.
The mount options SHOULD include "idmap" or "ridmap".
See: https://github.com/opencontainers/runtime-spec/blob/main/config.md#posix-platform-mounts