pub struct GeneratedNetworkDefinition { /* private fields */ }Expand description
A top-level network 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.
Implementations§
Source§impl GeneratedNetworkDefinition
impl GeneratedNetworkDefinition
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 network 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 network driver exactly once.
No driver, plugin, provider, or runtime availability validation is applied.
§Errors
Returns GenerationError::DuplicateField when already configured.
Sourcepub fn set_driver_opts(
&mut self,
driver_opts: Vec<GeneratedNetworkDriverOption>,
) -> Result<(), GenerationError>
pub fn set_driver_opts( &mut self, driver_opts: Vec<GeneratedNetworkDriverOption>, ) -> Result<(), GenerationError>
Sets the complete ordered unique network driver-options mapping exactly once.
An empty mapping remains explicit. String and number YAML scalar identities are selected
by GeneratedNetworkDriverOptionValue and are never inferred from their text.
§Errors
Rejects duplicate option names and duplicate field configuration. No driver-specific option, plugin, provider, or runtime semantics are validated.
Sourcepub fn set_enable_ipv6(
&mut self,
enable_ipv6: bool,
) -> Result<(), GenerationError>
pub fn set_enable_ipv6( &mut self, enable_ipv6: bool, ) -> Result<(), GenerationError>
Sets the literal IPv6-enable choice exactly once.
Omission remains distinct from an explicit false or true. Generation does not infer
defaults or validate driver, IPAM, provider, or runtime behavior.
§Errors
Returns GenerationError::DuplicateField when already configured.
Sourcepub fn set_internal(&mut self, internal: bool) -> Result<(), GenerationError>
pub fn set_internal(&mut self, internal: bool) -> Result<(), GenerationError>
Sets the literal internal-network choice exactly once.
Omission remains distinct from an explicit false or true. Generation does not infer
defaults or validate driver, IPAM, provider, or runtime behavior.
§Errors
Returns GenerationError::DuplicateField when already configured.
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 network-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 network name.
Sourcepub const fn driver(&self) -> Option<&GeneratedString>
pub const fn driver(&self) -> Option<&GeneratedString>
Returns the optional opaque network driver.
Sourcepub fn driver_opts(&self) -> Option<&[GeneratedNetworkDriverOption]>
pub fn driver_opts(&self) -> Option<&[GeneratedNetworkDriverOption]>
Returns the optional ordered driver-options mapping, including an explicit empty map.
Sourcepub const fn enable_ipv6(&self) -> Option<bool>
pub const fn enable_ipv6(&self) -> Option<bool>
Returns the explicitly selected IPv6-enable choice.
Sourcepub const fn internal(&self) -> Option<bool>
pub const fn internal(&self) -> Option<bool>
Returns the explicitly selected internal-network choice.
Sourcepub fn labels(&self) -> Option<&[GeneratedLabel]>
pub fn labels(&self) -> Option<&[GeneratedLabel]>
Returns the optional ordered network-label mapping, including an explicit empty map.
Trait Implementations§
Source§impl Clone for GeneratedNetworkDefinition
impl Clone for GeneratedNetworkDefinition
Source§fn clone(&self) -> GeneratedNetworkDefinition
fn clone(&self) -> GeneratedNetworkDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more