#[non_exhaustive]pub struct SwapConfig {
pub enabled: Option<bool>,
pub encryption_config: Option<EncryptionConfig>,
pub performance_profile: Option<PerformanceProfile>,
/* private fields */
}Expand description
Configuration for swap memory on a node pool.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: Option<bool>Optional. Enables or disables swap for the node pool.
encryption_config: Option<EncryptionConfig>Optional. If omitted, swap space is encrypted by default.
performance_profile: Option<PerformanceProfile>Optional. Defines the backing storage for the swap space. If omitted, defaults to the ‘boot_disk_profile’.
Implementations§
Source§impl SwapConfig
impl SwapConfig
pub fn new() -> Self
Sourcepub fn set_enabled<T>(self, v: T) -> Self
pub fn set_enabled<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_enabled<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_enabled<T>(self, v: Option<T>) -> Self
Sourcepub fn set_encryption_config<T>(self, v: T) -> Selfwhere
T: Into<EncryptionConfig>,
pub fn set_encryption_config<T>(self, v: T) -> Selfwhere
T: Into<EncryptionConfig>,
Sets the value of encryption_config.
§Example
use google_cloud_container_v1::model::linux_node_config::swap_config::EncryptionConfig;
let x = SwapConfig::new().set_encryption_config(EncryptionConfig::default()/* use setters */);Sourcepub fn set_or_clear_encryption_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncryptionConfig>,
pub fn set_or_clear_encryption_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncryptionConfig>,
Sets or clears the value of encryption_config.
§Example
use google_cloud_container_v1::model::linux_node_config::swap_config::EncryptionConfig;
let x = SwapConfig::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
let x = SwapConfig::new().set_or_clear_encryption_config(None::<EncryptionConfig>);Sourcepub fn set_performance_profile<T: Into<Option<PerformanceProfile>>>(
self,
v: T,
) -> Self
pub fn set_performance_profile<T: Into<Option<PerformanceProfile>>>( self, v: T, ) -> Self
Sets the value of performance_profile.
Note that all the setters affecting performance_profile are mutually
exclusive.
§Example
use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
let x = SwapConfig::new().set_performance_profile(Some(
google_cloud_container_v1::model::linux_node_config::swap_config::PerformanceProfile::BootDiskProfile(BootDiskProfile::default().into())));Sourcepub fn boot_disk_profile(&self) -> Option<&Box<BootDiskProfile>>
pub fn boot_disk_profile(&self) -> Option<&Box<BootDiskProfile>>
The value of performance_profile
if it holds a BootDiskProfile, None if the field is not set or
holds a different branch.
Sourcepub fn set_boot_disk_profile<T: Into<Box<BootDiskProfile>>>(self, v: T) -> Self
pub fn set_boot_disk_profile<T: Into<Box<BootDiskProfile>>>(self, v: T) -> Self
Sets the value of performance_profile
to hold a BootDiskProfile.
Note that all the setters affecting performance_profile are
mutually exclusive.
§Example
use google_cloud_container_v1::model::linux_node_config::swap_config::BootDiskProfile;
let x = SwapConfig::new().set_boot_disk_profile(BootDiskProfile::default()/* use setters */);
assert!(x.boot_disk_profile().is_some());
assert!(x.ephemeral_local_ssd_profile().is_none());
assert!(x.dedicated_local_ssd_profile().is_none());Sourcepub fn ephemeral_local_ssd_profile(
&self,
) -> Option<&Box<EphemeralLocalSsdProfile>>
pub fn ephemeral_local_ssd_profile( &self, ) -> Option<&Box<EphemeralLocalSsdProfile>>
The value of performance_profile
if it holds a EphemeralLocalSsdProfile, None if the field is not set or
holds a different branch.
Sourcepub fn set_ephemeral_local_ssd_profile<T: Into<Box<EphemeralLocalSsdProfile>>>(
self,
v: T,
) -> Self
pub fn set_ephemeral_local_ssd_profile<T: Into<Box<EphemeralLocalSsdProfile>>>( self, v: T, ) -> Self
Sets the value of performance_profile
to hold a EphemeralLocalSsdProfile.
Note that all the setters affecting performance_profile are
mutually exclusive.
§Example
use google_cloud_container_v1::model::linux_node_config::swap_config::EphemeralLocalSsdProfile;
let x = SwapConfig::new().set_ephemeral_local_ssd_profile(EphemeralLocalSsdProfile::default()/* use setters */);
assert!(x.ephemeral_local_ssd_profile().is_some());
assert!(x.boot_disk_profile().is_none());
assert!(x.dedicated_local_ssd_profile().is_none());Sourcepub fn dedicated_local_ssd_profile(
&self,
) -> Option<&Box<DedicatedLocalSsdProfile>>
pub fn dedicated_local_ssd_profile( &self, ) -> Option<&Box<DedicatedLocalSsdProfile>>
The value of performance_profile
if it holds a DedicatedLocalSsdProfile, None if the field is not set or
holds a different branch.
Sourcepub fn set_dedicated_local_ssd_profile<T: Into<Box<DedicatedLocalSsdProfile>>>(
self,
v: T,
) -> Self
pub fn set_dedicated_local_ssd_profile<T: Into<Box<DedicatedLocalSsdProfile>>>( self, v: T, ) -> Self
Sets the value of performance_profile
to hold a DedicatedLocalSsdProfile.
Note that all the setters affecting performance_profile are
mutually exclusive.
§Example
use google_cloud_container_v1::model::linux_node_config::swap_config::DedicatedLocalSsdProfile;
let x = SwapConfig::new().set_dedicated_local_ssd_profile(DedicatedLocalSsdProfile::default()/* use setters */);
assert!(x.dedicated_local_ssd_profile().is_some());
assert!(x.boot_disk_profile().is_none());
assert!(x.ephemeral_local_ssd_profile().is_none());Trait Implementations§
Source§impl Clone for SwapConfig
impl Clone for SwapConfig
Source§fn clone(&self) -> SwapConfig
fn clone(&self) -> SwapConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more