Skip to main content

SandboxConfigPatch

Struct SandboxConfigPatch 

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

A sparse, presence-aware patch for SandboxSpec.

Implementations§

Source§

impl SandboxConfigPatch

Source

pub fn new() -> Self

Create an empty patch that leaves every target field unchanged.

Source

pub fn name(self, value: String) -> Self

Set the name field in this patch.

Source

pub fn image(self, value: RootfsSource) -> Self

Set the image field in this patch.

Source

pub fn resources(self, patch: SandboxResourcesPatch) -> Self

Set the resources field in this patch.

Source

pub fn runtime(self, patch: SandboxRuntimeOptionsPatch) -> Self

Set the runtime field in this patch.

Source

pub fn env(self, value: Vec<EnvVar>) -> Self

Merge value into the env field.

Source

pub fn labels(self, value: BTreeMap<String, String>) -> Self

Merge value into the labels field.

Source

pub fn rlimits(self, value: Vec<Rlimit>) -> Self

Set the rlimits field in this patch.

Source

pub fn mounts(self, value: Vec<VolumeMount>) -> Self

Set the mounts field in this patch.

Source

pub fn patches(self, value: Vec<Patch>) -> Self

Set the patches field in this patch.

Source

pub fn network(self, patch: NetworkSpecPatch) -> Self

Set the network field in this patch.

Source

pub fn vsock(self, patch: VsockSpecPatch) -> Self

Set the vsock field in this patch.

Source

pub fn init(self, value: HandoffInit) -> Self

Set the init field in this patch.

Source

pub fn pull_policy(self, value: PullPolicy) -> Self

Set the pull_policy field in this patch.

Source

pub fn security_profile(self, value: SecurityProfile) -> Self

Set the security_profile field in this patch.

Source

pub fn deployment_profile(self, value: DeploymentProfile) -> Self

Set the deployment_profile field in this patch.

Source

pub fn lifecycle(self, patch: SandboxPolicyPatch) -> Self

Set the lifecycle field in this patch.

Source

pub fn replace_env(self, value: Vec<EnvVar>) -> Self

Replace the complete env field.

Source

pub fn replace_labels(self, value: BTreeMap<String, String>) -> Self

Replace the complete labels field.

Source

pub fn clear_name(self) -> Self

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

Source

pub fn clear_image(self) -> Self

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

Source

pub fn clear_resources(self) -> Self

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

Source

pub fn clear_runtime(self) -> Self

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

Source

pub fn clear_env(self) -> Self

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

Source

pub fn clear_labels(self) -> Self

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

Source

pub fn clear_rlimits(self) -> Self

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

Source

pub fn clear_mounts(self) -> Self

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

Source

pub fn clear_patches(self) -> Self

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

Source

pub fn clear_network(self) -> Self

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

Source

pub fn clear_vsock(self) -> Self

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

Source

pub fn clear_init(self) -> Self

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

Source

pub fn clear_pull_policy(self) -> Self

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

Source

pub fn clear_security_profile(self) -> Self

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

Source

pub fn clear_deployment_profile(self) -> Self

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

Source

pub fn clear_lifecycle(self) -> Self

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

Source

pub fn modify_resources( self, modify: impl FnOnce(SandboxResourcesPatch) -> SandboxResourcesPatch, ) -> Self

Transform the current nested resources patch.

Source

pub fn modify_runtime( self, modify: impl FnOnce(SandboxRuntimeOptionsPatch) -> SandboxRuntimeOptionsPatch, ) -> Self

Transform the current nested runtime patch.

Source

pub fn modify_network( self, modify: impl FnOnce(NetworkSpecPatch) -> NetworkSpecPatch, ) -> Self

Transform the current nested network patch.

Source

pub fn modify_vsock( self, modify: impl FnOnce(VsockSpecPatch) -> VsockSpecPatch, ) -> Self

Transform the current nested vsock patch.

Source

pub fn modify_lifecycle( self, modify: impl FnOnce(SandboxPolicyPatch) -> SandboxPolicyPatch, ) -> Self

Transform the current nested lifecycle 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 SandboxSpec)

Apply every present field to an existing value.

Source

pub fn from_present_fields(value: SandboxSpec) -> Self

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

Trait Implementations§

Source§

impl Clone for SandboxConfigPatch

Source§

fn clone(&self) -> SandboxConfigPatch

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 SandboxConfigPatch

Source§

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

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

impl Default for SandboxConfigPatch

Source§

fn default() -> SandboxConfigPatch

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

impl From<SandboxSpec> for SandboxConfigPatch

Source§

fn from(value: SandboxSpec) -> 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.