#[non_exhaustive]pub struct VmExtensionPolicyLabelSelector {
pub inclusion_labels: HashMap<String, String>,
/* private fields */
}Available on crate features
global-vm-extension-policies or zone-vm-extension-policies only.Expand description
A LabelSelector is applied to a VM only if it matches all the specified labels.
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.inclusion_labels: HashMap<String, String>Optional. A map of key-value pairs representing VM labels. VMs must have all of the labels specified in this map to be selected (logical AND).
e.g. If the inclusion_labels are {(“key1”, “value1”), (“key2”,
“value2”)}, the VM labels must contain both (“key1”, “value1”) and
(“key2”, “value2”) to be selected. If the VM labels are (“key1”,
“value1”) and (“something”, “else”), it will not be selected.
If the map is empty, it’s considered a match.
Implementations§
Source§impl VmExtensionPolicyLabelSelector
impl VmExtensionPolicyLabelSelector
Sourcepub fn set_inclusion_labels<T, K, V>(self, v: T) -> Self
pub fn set_inclusion_labels<T, K, V>(self, v: T) -> Self
Sets the value of inclusion_labels.
§Example
ⓘ
let x = VmExtensionPolicyLabelSelector::new().set_inclusion_labels([
("key0", "abc"),
("key1", "xyz"),
]);Trait Implementations§
Source§impl Clone for VmExtensionPolicyLabelSelector
impl Clone for VmExtensionPolicyLabelSelector
Source§fn clone(&self) -> VmExtensionPolicyLabelSelector
fn clone(&self) -> VmExtensionPolicyLabelSelector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for VmExtensionPolicyLabelSelector
impl Default for VmExtensionPolicyLabelSelector
Source§fn default() -> VmExtensionPolicyLabelSelector
fn default() -> VmExtensionPolicyLabelSelector
Returns the “default value” for a type. Read more
Source§impl PartialEq for VmExtensionPolicyLabelSelector
impl PartialEq for VmExtensionPolicyLabelSelector
Source§fn eq(&self, other: &VmExtensionPolicyLabelSelector) -> bool
fn eq(&self, other: &VmExtensionPolicyLabelSelector) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VmExtensionPolicyLabelSelector
Auto Trait Implementations§
impl Freeze for VmExtensionPolicyLabelSelector
impl RefUnwindSafe for VmExtensionPolicyLabelSelector
impl Send for VmExtensionPolicyLabelSelector
impl Sync for VmExtensionPolicyLabelSelector
impl Unpin for VmExtensionPolicyLabelSelector
impl UnsafeUnpin for VmExtensionPolicyLabelSelector
impl UnwindSafe for VmExtensionPolicyLabelSelector
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