pub struct GeneratedVolumeDefinition { /* private fields */ }Expand description
A top-level application-owned volume definition with optional driver configuration.
This type is intentionally distinct from GeneratedResource, which remains the compatible
basic/external lifecycle API shared by top-level networks and volumes. External volumes cannot
use this driver-configured API.
Implementations§
Source§impl GeneratedVolumeDefinition
impl GeneratedVolumeDefinition
Sourcepub fn application(name: impl Into<String>) -> Result<Self, GenerationError>
pub fn application(name: impl Into<String>) -> Result<Self, GenerationError>
Sourcepub fn set_custom_name(
&mut self,
name: impl Into<String>,
) -> Result<(), GenerationError>
pub fn set_custom_name( &mut self, name: impl Into<String>, ) -> Result<(), GenerationError>
Sets the exact platform-level volume name once.
§Errors
Rejects an empty/NUL-bearing name and duplicate configuration.
Sourcepub fn set_driver(
&mut self,
driver: GeneratedString,
) -> Result<(), GenerationError>
pub fn set_driver( &mut self, driver: GeneratedString, ) -> Result<(), GenerationError>
Sets one opaque volume driver exactly once.
No driver, plugin, provider, runtime, default, or image semantics validation is applied.
§Errors
Returns GenerationError::DuplicateField when already configured.
Sourcepub fn set_driver_opts(
&mut self,
driver_opts: Vec<GeneratedVolumeDriverOption>,
) -> Result<(), GenerationError>
pub fn set_driver_opts( &mut self, driver_opts: Vec<GeneratedVolumeDriverOption>, ) -> Result<(), GenerationError>
Sets the complete ordered unique volume driver-options mapping exactly once.
An empty mapping remains explicit. String and number YAML scalar identities are selected
by GeneratedVolumeDriverOptionValue and are never inferred from their text.
§Errors
Rejects duplicate option names and duplicate field configuration. No driver-specific option, plugin, provider, runtime, default, or image semantics are validated.
Sourcepub fn set_labels(
&mut self,
labels: Vec<GeneratedLabel>,
) -> Result<(), GenerationError>
pub fn set_labels( &mut self, labels: Vec<GeneratedLabel>, ) -> Result<(), GenerationError>
Sets the complete ordered unique volume-label mapping exactly once.
An empty mapping remains explicit. Labels use the same explicit string-value contract as generated service labels, so neither key-only nor non-string label forms are generated.
§Errors
Rejects duplicate label names and duplicate field configuration. No provider, runtime, or injected-label equivalence is inferred.
Sourcepub fn custom_name(&self) -> Option<&str>
pub fn custom_name(&self) -> Option<&str>
Returns the optional exact platform-level volume name.
Sourcepub const fn driver(&self) -> Option<&GeneratedString>
pub const fn driver(&self) -> Option<&GeneratedString>
Returns the optional opaque volume driver.
Sourcepub fn driver_opts(&self) -> Option<&[GeneratedVolumeDriverOption]>
pub fn driver_opts(&self) -> Option<&[GeneratedVolumeDriverOption]>
Returns the optional ordered driver-options mapping, including an explicit empty map.
Sourcepub fn labels(&self) -> Option<&[GeneratedLabel]>
pub fn labels(&self) -> Option<&[GeneratedLabel]>
Returns the optional ordered volume-label mapping, including an explicit empty map.
Trait Implementations§
Source§impl Clone for GeneratedVolumeDefinition
impl Clone for GeneratedVolumeDefinition
Source§fn clone(&self) -> GeneratedVolumeDefinition
fn clone(&self) -> GeneratedVolumeDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more