pub struct Mount {
pub id: String,
pub mount_type: MountType,
pub source: String,
pub target: String,
pub read_only: bool,
pub required: bool,
pub description: Option<String>,
}Expand description
File/directory mount specification.
Fields§
§id: StringUnique identifier within context.
mount_type: MountTypeMount type.
source: StringHost path or source (supports env var expansion like ${HOME}).
target: StringPath inside execution environment.
read_only: boolRead-only flag.
required: boolRequired or optional.
description: Option<String>Human-readable description.
Implementations§
Source§impl Mount
impl Mount
Sourcepub fn directory(
id: impl Into<String>,
source: impl Into<String>,
target: impl Into<String>,
) -> Self
pub fn directory( id: impl Into<String>, source: impl Into<String>, target: impl Into<String>, ) -> Self
Create a new directory mount.
Sourcepub fn file(
id: impl Into<String>,
source: impl Into<String>,
target: impl Into<String>,
) -> Self
pub fn file( id: impl Into<String>, source: impl Into<String>, target: impl Into<String>, ) -> Self
Create a new file mount.
Sourcepub fn volume(
id: impl Into<String>,
name: impl Into<String>,
target: impl Into<String>,
) -> Self
pub fn volume( id: impl Into<String>, name: impl Into<String>, target: impl Into<String>, ) -> Self
Create a named volume mount (Docker).
Sourcepub fn tmpfs(
id: impl Into<String>,
target: impl Into<String>,
size_mb: u32,
) -> Self
pub fn tmpfs( id: impl Into<String>, target: impl Into<String>, size_mb: u32, ) -> Self
Create a tmpfs mount.
Sourcepub fn config_file(
id: impl Into<String>,
template: impl Into<String>,
target: impl Into<String>,
) -> Self
pub fn config_file( id: impl Into<String>, template: impl Into<String>, target: impl Into<String>, ) -> Self
Create a config file mount from a template.
Sourcepub fn as_read_only(self) -> Self
pub fn as_read_only(self) -> Self
Set the mount as read-only.
Sourcepub fn as_read_write(self) -> Self
pub fn as_read_write(self) -> Self
Set the mount as read-write.
Sourcepub fn as_optional(self) -> Self
pub fn as_optional(self) -> Self
Set the mount as optional.
Sourcepub fn as_required(self) -> Self
pub fn as_required(self) -> Self
Set the mount as required.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add a description.
Sourcepub fn expand_source(&self) -> String
pub fn expand_source(&self) -> String
Expand environment variables in the source path.
Supports ${VAR} and $VAR syntax.
Sourcepub fn source_path(&self) -> PathBuf
pub fn source_path(&self) -> PathBuf
Get the source as a PathBuf with environment variables expanded.
Sourcepub fn target_path(&self) -> PathBuf
pub fn target_path(&self) -> PathBuf
Get the target as a PathBuf.
Sourcepub fn requires_source(&self) -> bool
pub fn requires_source(&self) -> bool
Check if this mount requires a source path to exist.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mount
impl<'de> Deserialize<'de> for Mount
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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