Struct MountPointBuilder

Source
pub struct MountPointBuilder { /* private fields */ }
Expand description

Builder for MountPoint.

Implementations§

Source§

impl MountPointBuilder

Source

pub fn source<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self

Source is the source path of the mount. E.g. mount --bind /foo /bar, /foo is the Source.

Source

pub fn destination<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self

Destination is the path relative to the container root (/) to the mount point It is where the Source is mounted to.

Source

pub fn rw<VALUE: Into<Option<bool>>>(&mut self, value: VALUE) -> &mut Self

RW is set to true when the mountpoint should be mounted as read-write.

Source

pub fn name<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self

Name is the name reference to the underlying data defined by Source e.g., the volume name.

Source

pub fn driver<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self

Driver is the volume driver used to create the volume (if it is a volume).

Source

pub fn mount_type<VALUE: Into<Option<MountType>>>( &mut self, value: VALUE, ) -> &mut Self

Source

pub fn mode<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self

mode is the comma separated list of options supplied by the user when creating the bind/volume mount. Note mode is not used on Windows

Source

pub fn propagation<VALUE: Into<Option<MountPropagation>>>( &mut self, value: VALUE, ) -> &mut Self

Propagation describes how the mounts are propagated from the host into the mount point, and vice-versa. See https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt Note Propagation is not used on Windows

Source

pub fn id<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self

ID is the opaque ID used to pass to the volume driver. This should be set by calls to Mount and unset by calls to Unmount

Source

pub fn spec<VALUE: Into<Option<Mount>>>(&mut self, value: VALUE) -> &mut Self

Spec is a copy of the API request that created this mount.

Source

pub fn skip_mountpoint_creation<VALUE: Into<Option<bool>>>( &mut self, value: VALUE, ) -> &mut Self

Some bind mounts should not be automatically created. (Some are auto-created for backwards-compatibility) This is checked on the API but setting this here prevents race conditions. where a bind dir existed during validation was removed before reaching the setup code.

Source

pub fn active<VALUE: Into<Option<i32>>>(&mut self, value: VALUE) -> &mut Self

Track usage of this mountpoint Specifically needed for containers which are running and calls to docker cp because both these actions require mounting the volumes.

Source

pub fn build(&self) -> Result<MountPoint, String>

Builds a new MountPoint.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for MountPointBuilder

Source§

fn clone(&self) -> MountPointBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for MountPointBuilder

Source§

fn default() -> MountPointBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more