#[non_exhaustive]pub struct FixedOrPercent {
pub calculated: Option<i32>,
pub fixed: Option<i32>,
pub percent: Option<i32>,
/* private fields */
}Available on crate features
autoscalers or instance-group-managers or region-autoscalers or region-instance-group-managers only.Expand description
Encapsulates numeric value that can be either absolute or relative.
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.calculated: Option<i32>Output only. [Output Only] Absolute value of VM instances calculated based on the specific mode.
- If the value is fixed, then the calculated
value is equal to the fixed value.
- If the value is a percent, then the
calculated
value is percent/100 * targetSize. For example,
the calculated value of a 80% of a managed instance group
with 150 instances would be (80/100 * 150) = 120 VM instances. If there
is a remainder, the number is rounded.fixed: Option<i32>Specifies a fixed number of VM instances. This must be a positive integer.
percent: Option<i32>Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
Implementations§
Source§impl FixedOrPercent
impl FixedOrPercent
pub fn new() -> Self
Sourcepub fn set_calculated<T>(self, v: T) -> Self
pub fn set_calculated<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_calculated<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_calculated<T>(self, v: Option<T>) -> Self
Sets or clears the value of calculated.
§Example
ⓘ
let x = FixedOrPercent::new().set_or_clear_calculated(Some(42));
let x = FixedOrPercent::new().set_or_clear_calculated(None::<i32>);Sourcepub fn set_or_clear_fixed<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_fixed<T>(self, v: Option<T>) -> Self
Sourcepub fn set_percent<T>(self, v: T) -> Self
pub fn set_percent<T>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for FixedOrPercent
impl Clone for FixedOrPercent
Source§fn clone(&self) -> FixedOrPercent
fn clone(&self) -> FixedOrPercent
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 FixedOrPercent
impl Debug for FixedOrPercent
Source§impl Default for FixedOrPercent
impl Default for FixedOrPercent
Source§fn default() -> FixedOrPercent
fn default() -> FixedOrPercent
Returns the “default value” for a type. Read more
Source§impl Message for FixedOrPercent
impl Message for FixedOrPercent
Source§impl PartialEq for FixedOrPercent
impl PartialEq for FixedOrPercent
impl StructuralPartialEq for FixedOrPercent
Auto Trait Implementations§
impl Freeze for FixedOrPercent
impl RefUnwindSafe for FixedOrPercent
impl Send for FixedOrPercent
impl Sync for FixedOrPercent
impl Unpin for FixedOrPercent
impl UnwindSafe for FixedOrPercent
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