Struct specifications::container::VolumeBind
source · pub struct VolumeBind {
pub host: PathBuf,
pub container: PathBuf,
pub options: Vec<VolumeBindOption>,
}
Expand description
Defines a single Docker volume binding.
Fields§
§host: PathBuf
The source location, on the host.
container: PathBuf
The target location, on the container.
options: Vec<VolumeBindOption>
Any options for the bind.
Implementations§
source§impl VolumeBind
impl VolumeBind
sourcepub fn new(
host: impl Into<PathBuf>,
container: impl Into<PathBuf>,
options: Vec<VolumeBindOption>,
) -> Result<Self, VolumeBindError>
pub fn new( host: impl Into<PathBuf>, container: impl Into<PathBuf>, options: Vec<VolumeBindOption>, ) -> Result<Self, VolumeBindError>
Constructor for VolumeBind that does not initialize it with special options.
§Arguments
host
: The path to the host folder. Note that this path must be absolute.container
: The path to the container folder. Note that this path must be absolute.options
: The VolumeBindOptions that further customize the bind(s).
§Returns
A new VolumeBind instance.
§Errors
This function may error if either of the given paths is not actually absolute.
sourcepub fn new_readonly(
host: impl Into<PathBuf>,
container: impl Into<PathBuf>,
) -> Result<Self, VolumeBindError>
pub fn new_readonly( host: impl Into<PathBuf>, container: impl Into<PathBuf>, ) -> Result<Self, VolumeBindError>
Constructor for VolumeBind that initializes it as a read-only bind.
§Arguments
host
: The path to the host folder. Note that this path must be absolute.container
: The path to the container folder. Note that this path must be absolute.
§Returns
A new VolumeBind instance.
§Errors
This function may error if either of the given paths is not actually absolute.
sourcepub fn new_readwrite(
host: impl Into<PathBuf>,
container: impl Into<PathBuf>,
) -> Result<Self, VolumeBindError>
pub fn new_readwrite( host: impl Into<PathBuf>, container: impl Into<PathBuf>, ) -> Result<Self, VolumeBindError>
Constructor for VolumeBind that initializes it as a read/write bind.
§Arguments
host
: The path to the host folder. Note that this path must be absolute.container
: The path to the container folder. Note that this path must be absolute.
§Returns
A new VolumeBind instance.
§Errors
This function may error if either of the given paths is not actually absolute.
sourcepub fn docker(&self) -> VolumeBindDockerDisplay<'_>
pub fn docker(&self) -> VolumeBindDockerDisplay<'_>
Returns a formatter that writes a Docker-compatible version of this VolumeBindOption.
Trait Implementations§
source§impl Clone for VolumeBind
impl Clone for VolumeBind
source§fn clone(&self) -> VolumeBind
fn clone(&self) -> VolumeBind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for VolumeBind
impl RefUnwindSafe for VolumeBind
impl Send for VolumeBind
impl Sync for VolumeBind
impl Unpin for VolumeBind
impl UnwindSafe for VolumeBind
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request