pub struct BindConfig {
pub binds: Vec<String>,
}Expand description
Bind mount configuration for containers.
Stores bind mount specifications as HOST:CONTAINER:MODE where
MODE is rw (read-write) or ro (read-only).
Fields§
§binds: Vec<String>Bind mount specifications in internal format: “host:container:rw” or “host:container:ro”
Implementations§
Source§impl BindConfig
impl BindConfig
Sourcepub fn from_state(state: &State) -> Self
pub fn from_state(state: &State) -> Self
Read bind config from a state file’s key-value pairs.
Sourcepub fn write_to_state(&self, state: &mut State)
pub fn write_to_state(&self, state: &mut State)
Write bind config into a state’s key-value pairs.
Sourcepub fn to_nspawn_args(&self) -> Vec<String>
pub fn to_nspawn_args(&self) -> Vec<String>
Generate systemd-nspawn arguments for bind mounts.
Returns individual arguments suitable for direct inclusion in a
systemd unit file’s ExecStart line. Each element is one nspawn flag.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate all bind mount specifications.
Checks that:
- Both paths are absolute
- Host path exists
- No
..components (path traversal prevention) - Format is valid
Sourcepub fn from_cli_args(args: Vec<String>) -> Result<Self>
pub fn from_cli_args(args: Vec<String>) -> Result<Self>
Parse CLI bind arguments into internal format.
Input format: HOST:CONTAINER[:ro]
Output format: host:container:rw or host:container:ro
Trait Implementations§
Source§impl Clone for BindConfig
impl Clone for BindConfig
Source§fn clone(&self) -> BindConfig
fn clone(&self) -> BindConfig
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 moreSource§impl Debug for BindConfig
impl Debug for BindConfig
Source§impl Default for BindConfig
impl Default for BindConfig
Source§fn default() -> BindConfig
fn default() -> BindConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for BindConfig
impl PartialEq for BindConfig
impl StructuralPartialEq for BindConfig
Auto Trait Implementations§
impl Freeze for BindConfig
impl RefUnwindSafe for BindConfig
impl Send for BindConfig
impl Sync for BindConfig
impl Unpin for BindConfig
impl UnsafeUnpin for BindConfig
impl UnwindSafe for BindConfig
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