#[non_exhaustive]pub struct ResourcePolicyWorkloadPolicy {
pub accelerator_topology: Option<String>,
pub max_topology_distance: Option<MaxTopologyDistance>,
pub type: Option<Type>,
/* private fields */
}Available on crate feature
resource-policies only.Expand description
Represents the workload policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.accelerator_topology: Option<String>Specifies the topology required to create a partition for VMs that have interconnected GPUs.
max_topology_distance: Option<MaxTopologyDistance>Specifies the maximum distance between instances.
type: Option<Type>Specifies the intent of the instance placement in the MIG.
Implementations§
Source§impl ResourcePolicyWorkloadPolicy
impl ResourcePolicyWorkloadPolicy
pub fn new() -> Self
Sourcepub fn set_accelerator_topology<T>(self, v: T) -> Self
pub fn set_accelerator_topology<T>(self, v: T) -> Self
Sets the value of accelerator_topology.
§Example
ⓘ
let x = ResourcePolicyWorkloadPolicy::new().set_accelerator_topology("example");Sourcepub fn set_or_clear_accelerator_topology<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_accelerator_topology<T>(self, v: Option<T>) -> Self
Sets or clears the value of accelerator_topology.
§Example
ⓘ
let x = ResourcePolicyWorkloadPolicy::new().set_or_clear_accelerator_topology(Some("example"));
let x = ResourcePolicyWorkloadPolicy::new().set_or_clear_accelerator_topology(None::<String>);Sourcepub fn set_max_topology_distance<T>(self, v: T) -> Selfwhere
T: Into<MaxTopologyDistance>,
pub fn set_max_topology_distance<T>(self, v: T) -> Selfwhere
T: Into<MaxTopologyDistance>,
Sets the value of max_topology_distance.
§Example
ⓘ
use google_cloud_compute_v1::model::resource_policy_workload_policy::MaxTopologyDistance;
let x0 = ResourcePolicyWorkloadPolicy::new().set_max_topology_distance(MaxTopologyDistance::Cluster);
let x1 = ResourcePolicyWorkloadPolicy::new().set_max_topology_distance(MaxTopologyDistance::Subblock);Sourcepub fn set_or_clear_max_topology_distance<T>(self, v: Option<T>) -> Selfwhere
T: Into<MaxTopologyDistance>,
pub fn set_or_clear_max_topology_distance<T>(self, v: Option<T>) -> Selfwhere
T: Into<MaxTopologyDistance>,
Sets or clears the value of max_topology_distance.
§Example
ⓘ
use google_cloud_compute_v1::model::resource_policy_workload_policy::MaxTopologyDistance;
let x0 = ResourcePolicyWorkloadPolicy::new().set_or_clear_max_topology_distance(Some(MaxTopologyDistance::Cluster));
let x1 = ResourcePolicyWorkloadPolicy::new().set_or_clear_max_topology_distance(Some(MaxTopologyDistance::Subblock));
let x_none = ResourcePolicyWorkloadPolicy::new().set_or_clear_max_topology_distance(None::<MaxTopologyDistance>);Sourcepub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for ResourcePolicyWorkloadPolicy
impl Clone for ResourcePolicyWorkloadPolicy
Source§fn clone(&self) -> ResourcePolicyWorkloadPolicy
fn clone(&self) -> ResourcePolicyWorkloadPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourcePolicyWorkloadPolicy
impl Debug for ResourcePolicyWorkloadPolicy
Source§impl Default for ResourcePolicyWorkloadPolicy
impl Default for ResourcePolicyWorkloadPolicy
Source§fn default() -> ResourcePolicyWorkloadPolicy
fn default() -> ResourcePolicyWorkloadPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for ResourcePolicyWorkloadPolicy
impl PartialEq for ResourcePolicyWorkloadPolicy
Source§fn eq(&self, other: &ResourcePolicyWorkloadPolicy) -> bool
fn eq(&self, other: &ResourcePolicyWorkloadPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResourcePolicyWorkloadPolicy
Auto Trait Implementations§
impl Freeze for ResourcePolicyWorkloadPolicy
impl RefUnwindSafe for ResourcePolicyWorkloadPolicy
impl Send for ResourcePolicyWorkloadPolicy
impl Sync for ResourcePolicyWorkloadPolicy
impl Unpin for ResourcePolicyWorkloadPolicy
impl UnwindSafe for ResourcePolicyWorkloadPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more