Skip to main content

NetworkSpecPatch

Struct NetworkSpecPatch 

Source
pub struct NetworkSpecPatch { /* private fields */ }
Expand description

A sparse, presence-aware patch for NetworkSpec.

Implementations§

Source§

impl NetworkSpecPatch

Source

pub fn new() -> Self

Create an empty patch that leaves every target field unchanged.

Source

pub fn enabled(self, value: bool) -> Self

Set the enabled field in this patch.

Source

pub fn interface(self, patch: InterfaceOverridesPatch) -> Self

Set the interface field in this patch.

Source

pub fn ports(self, value: Vec<PublishedPortSpec>) -> Self

Set the ports field in this patch.

Source

pub fn policy(self, value: NetworkPolicy) -> Self

Set the policy field in this patch.

Source

pub fn dns(self, patch: DnsConfigPatch) -> Self

Set the dns field in this patch.

Source

pub fn tls(self, patch: TlsConfigPatch) -> Self

Set the tls field in this patch.

Source

pub fn secrets(self, patch: SecretsConfigPatch) -> Self

Set the secrets field in this patch.

Source

pub fn max_connections(self, value: usize) -> Self

Set the max_connections field in this patch.

Source

pub fn rate_limiter(self, patch: NetworkRateLimiterConfigPatch) -> Self

Set the rate_limiter field in this patch.

Source

pub fn trust_host_cas(self, value: bool) -> Self

Set the trust_host_cas field in this patch.

Source

pub fn outbound_proxy(self, value: OutboundProxy) -> Self

Set the outbound_proxy field in this patch.

Source

pub fn clear_enabled(self) -> Self

Remove enabled from this patch so applying it leaves the target unchanged.

Source

pub fn clear_interface(self) -> Self

Remove interface from this patch so applying it leaves the target unchanged.

Source

pub fn clear_ports(self) -> Self

Remove ports from this patch so applying it leaves the target unchanged.

Source

pub fn clear_policy(self) -> Self

Remove policy from this patch so applying it leaves the target unchanged.

Source

pub fn clear_dns(self) -> Self

Remove dns from this patch so applying it leaves the target unchanged.

Source

pub fn clear_tls(self) -> Self

Remove tls from this patch so applying it leaves the target unchanged.

Source

pub fn clear_secrets(self) -> Self

Remove secrets from this patch so applying it leaves the target unchanged.

Source

pub fn clear_max_connections(self) -> Self

Remove max_connections from this patch so applying it leaves the target unchanged.

Source

pub fn clear_rate_limiter(self) -> Self

Remove rate_limiter from this patch so applying it leaves the target unchanged.

Source

pub fn clear_trust_host_cas(self) -> Self

Remove trust_host_cas from this patch so applying it leaves the target unchanged.

Source

pub fn clear_outbound_proxy(self) -> Self

Remove outbound_proxy from this patch so applying it leaves the target unchanged.

Source

pub fn modify_interface( self, modify: impl FnOnce(InterfaceOverridesPatch) -> InterfaceOverridesPatch, ) -> Self

Transform the current nested interface patch.

Source

pub fn modify_dns( self, modify: impl FnOnce(DnsConfigPatch) -> DnsConfigPatch, ) -> Self

Transform the current nested dns patch.

Source

pub fn modify_tls( self, modify: impl FnOnce(TlsConfigPatch) -> TlsConfigPatch, ) -> Self

Transform the current nested tls patch.

Source

pub fn modify_secrets( self, modify: impl FnOnce(SecretsConfigPatch) -> SecretsConfigPatch, ) -> Self

Transform the current nested secrets patch.

Source

pub fn modify_rate_limiter( self, modify: impl FnOnce(NetworkRateLimiterConfigPatch) -> NetworkRateLimiterConfigPatch, ) -> Self

Transform the current nested rate_limiter patch.

Source

pub fn overlay(self, higher: Self) -> Self

Overlay a higher-precedence patch using each field’s declared strategy.

Source

pub fn apply_to(self, target: &mut NetworkSpec)

Apply every present field to an existing value.

Source

pub fn from_present_fields(value: NetworkSpec) -> Self

Convert non-null fields into a changeset, treating Option::None as absent.

Trait Implementations§

Source§

impl Clone for NetworkSpecPatch

Source§

fn clone(&self) -> NetworkSpecPatch

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 NetworkSpecPatch

Source§

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

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

impl Default for NetworkSpecPatch

Source§

fn default() -> NetworkSpecPatch

Returns the “default value” for a type. Read more
Source§

impl From<NetworkSpec> for NetworkSpecPatch

Source§

fn from(value: NetworkSpec) -> Self

Converts to this type from the input type.

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<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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.