#[non_exhaustive]pub struct LocationPolicy {
pub locations: HashMap<String, LocationPolicyLocation>,
pub target_shape: Option<TargetShape>,
/* private fields */
}Available on crate features
instances or region-instances only.Expand description
Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region).
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.locations: HashMap<String, LocationPolicyLocation>Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.
target_shape: Option<TargetShape>Strategy for distributing VMs across zones in a region.
Implementations§
Source§impl LocationPolicy
impl LocationPolicy
pub fn new() -> Self
Sourcepub fn set_locations<T, K, V>(self, v: T) -> Self
pub fn set_locations<T, K, V>(self, v: T) -> Self
Sourcepub fn set_target_shape<T>(self, v: T) -> Selfwhere
T: Into<TargetShape>,
pub fn set_target_shape<T>(self, v: T) -> Selfwhere
T: Into<TargetShape>,
Sets the value of target_shape.
§Example
ⓘ
use google_cloud_compute_v1::model::location_policy::TargetShape;
let x0 = LocationPolicy::new().set_target_shape(TargetShape::AnySingleZone);
let x1 = LocationPolicy::new().set_target_shape(TargetShape::Balanced);Sourcepub fn set_or_clear_target_shape<T>(self, v: Option<T>) -> Selfwhere
T: Into<TargetShape>,
pub fn set_or_clear_target_shape<T>(self, v: Option<T>) -> Selfwhere
T: Into<TargetShape>,
Sets or clears the value of target_shape.
§Example
ⓘ
use google_cloud_compute_v1::model::location_policy::TargetShape;
let x0 = LocationPolicy::new().set_or_clear_target_shape(Some(TargetShape::AnySingleZone));
let x1 = LocationPolicy::new().set_or_clear_target_shape(Some(TargetShape::Balanced));
let x_none = LocationPolicy::new().set_or_clear_target_shape(None::<TargetShape>);Trait Implementations§
Source§impl Clone for LocationPolicy
impl Clone for LocationPolicy
Source§fn clone(&self) -> LocationPolicy
fn clone(&self) -> LocationPolicy
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 LocationPolicy
impl Debug for LocationPolicy
Source§impl Default for LocationPolicy
impl Default for LocationPolicy
Source§fn default() -> LocationPolicy
fn default() -> LocationPolicy
Returns the “default value” for a type. Read more
Source§impl Message for LocationPolicy
impl Message for LocationPolicy
Source§impl PartialEq for LocationPolicy
impl PartialEq for LocationPolicy
impl StructuralPartialEq for LocationPolicy
Auto Trait Implementations§
impl Freeze for LocationPolicy
impl RefUnwindSafe for LocationPolicy
impl Send for LocationPolicy
impl Sync for LocationPolicy
impl Unpin for LocationPolicy
impl UnwindSafe for LocationPolicy
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