Skip to main content

GeneratedNetworkDefinition

Struct GeneratedNetworkDefinition 

Source
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

Source

pub fn application(name: impl Into<String>) -> Result<Self, GenerationError>

Creates an application-owned network definition.

§Errors

Rejects an empty or NUL-bearing name.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn name(&self) -> &str

Returns the generated network name.

Source

pub fn custom_name(&self) -> Option<&str>

Returns the optional exact platform-level network name.

Source

pub const fn driver(&self) -> Option<&GeneratedString>

Returns the optional opaque network driver.

Source

pub fn driver_opts(&self) -> Option<&[GeneratedNetworkDriverOption]>

Returns the optional ordered driver-options mapping, including an explicit empty map.

Source

pub const fn enable_ipv6(&self) -> Option<bool>

Returns the explicitly selected IPv6-enable choice.

Source

pub const fn internal(&self) -> Option<bool>

Returns the explicitly selected internal-network choice.

Source

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

Source§

fn clone(&self) -> GeneratedNetworkDefinition

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeneratedNetworkDefinition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for GeneratedNetworkDefinition

Source§

impl PartialEq for GeneratedNetworkDefinition

Source§

fn eq(&self, other: &GeneratedNetworkDefinition) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GeneratedNetworkDefinition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.