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>,
) -> Mount
pub fn bind_mount( host_path: impl Into<String>, container_path: impl Into<String>, ) -> Mount
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>,
) -> Mount
pub fn volume_mount( name: impl Into<String>, container_path: impl Into<String>, ) -> Mount
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>) -> Mount
pub fn tmpfs_mount(container_path: impl Into<String>) -> Mount
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) -> Mount
pub fn with_access_mode(self, access_mode: AccessMode) -> Mount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more