Struct testcontainers::core::Mount
source · pub struct Mount { /* private fields */ }
Expand description
Represents a filesystem mount. For more information see Docker Storage documentation.
Implementations§
source§impl Mount
impl Mount
sourcepub fn bind_mount(
host_path: impl Into<String>,
container_path: impl Into<String>
) -> Self
pub fn bind_mount( host_path: impl Into<String>, container_path: impl Into<String> ) -> Self
Creates a bind-mount
.
Can be used to mount a file or directory on the host system into a container.
See bind-mounts documentation for more information.
sourcepub fn volume_mount(
name: impl Into<String>,
container_path: impl Into<String>
) -> Self
pub fn volume_mount( name: impl Into<String>, container_path: impl Into<String> ) -> Self
Creates a named volume
.
Can be used to share data between containers or persist data on the host system.
The volume isn’t removed when the container is removed.
See volumes documentation for more information.
sourcepub fn tmpfs_mount(container_path: impl Into<String>) -> Self
pub fn tmpfs_mount(container_path: impl Into<String>) -> Self
Creates a tmpfs
mount.
Can be used to mount a temporary filesystem in the container’s memory.
tmpfs
mount is removed when the container is removed.
See tmpfs documentation for more information.
sourcepub fn with_access_mode(self, access_mode: AccessMode) -> Self
pub fn with_access_mode(self, access_mode: AccessMode) -> Self
Sets the access mode for the mount.
Default is AccessMode::ReadWrite
.
sourcepub fn access_mode(&self) -> AccessMode
pub fn access_mode(&self) -> AccessMode
Docker mount access mode.
sourcepub fn mount_type(&self) -> MountType
pub fn mount_type(&self) -> MountType
Docker mount type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mount
impl RefUnwindSafe for Mount
impl Send for Mount
impl Sync for Mount
impl Unpin for Mount
impl UnwindSafe for Mount
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more