pub struct VolumeMount { /* private fields */ }Expand description
Volume mount configuration
Implementations§
Source§impl VolumeMount
impl VolumeMount
Sourcepub fn new(
host_path: impl AsRef<Path>,
container_path: impl AsRef<Path>,
read_only: bool,
) -> Result<Self>
pub fn new( host_path: impl AsRef<Path>, container_path: impl AsRef<Path>, read_only: bool, ) -> Result<Self>
Create a new volume mount with validation
§Arguments
host_path- Path on the host systemcontainer_path- Path inside the containerread_only- Whether mount is read-only
§Errors
Returns error if:
- Host path is not absolute
- Host path does not exist
- Container path is not absolute
- Path canonicalization fails
§Example
use clnrm_core::backend::volume::VolumeMount;
let mount = VolumeMount::new("/tmp/data", "/data", false)?;
assert!(!mount.is_read_only());Sourcepub fn from_config(config: &VolumeConfig) -> Result<Self>
pub fn from_config(config: &VolumeConfig) -> Result<Self>
Create from VolumeConfig with validation
Sourcepub fn container_path(&self) -> &Path
pub fn container_path(&self) -> &Path
Get container path
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Check if mount is read-only
Trait Implementations§
Source§impl Clone for VolumeMount
impl Clone for VolumeMount
Source§fn clone(&self) -> VolumeMount
fn clone(&self) -> VolumeMount
Returns a duplicate 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 VolumeMount
impl RefUnwindSafe for VolumeMount
impl Send for VolumeMount
impl Sync for VolumeMount
impl Unpin for VolumeMount
impl UnwindSafe for VolumeMount
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 moreSource§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