#[non_exhaustive]pub struct ResourceCommitment {
pub accelerator_type: Option<String>,
pub amount: Option<i64>,
pub type: Option<Type>,
/* private fields */
}Available on crate feature
region-commitments only.Expand description
Commitment for a particular hardware resource (a commitment is composed of one or more of these).
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_type: Option<String>Name of the accelerator type or GPU resource. Specify this field only when the type of hardware resource is ACCELERATOR.
amount: Option<i64>The quantity of the hardware resource that you want to commit to purchasing (in a type-dependent unit).
- For vCPUs, you must specify an integer value.
- For memory, you specify the amount of MB that you want. The value you specify must be a multiple of 256 MB, with up to 6.5 GB of memory per every vCPU.
- For GPUs, you must specify an integer value.
- For Local SSD disks, you must specify the amount in GB. The size of a single Local SSD disk is 375 GB.
type: Option<Type>The type of hardware resource that you want to specify. You can specify any of the following values:
- VCPU
- MEMORY
- LOCAL_SSD
- ACCELERATOR
Specify as a separate entry in the list for each individual resource type.
Implementations§
Source§impl ResourceCommitment
impl ResourceCommitment
pub fn new() -> Self
Sourcepub fn set_accelerator_type<T>(self, v: T) -> Self
pub fn set_accelerator_type<T>(self, v: T) -> Self
Sets the value of accelerator_type.
§Example
ⓘ
let x = ResourceCommitment::new().set_accelerator_type("example");Sourcepub fn set_or_clear_accelerator_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_accelerator_type<T>(self, v: Option<T>) -> Self
Sets or clears the value of accelerator_type.
§Example
ⓘ
let x = ResourceCommitment::new().set_or_clear_accelerator_type(Some("example"));
let x = ResourceCommitment::new().set_or_clear_accelerator_type(None::<String>);Sourcepub fn set_amount<T>(self, v: T) -> Self
pub fn set_amount<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_amount<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_amount<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
Sets or clears the value of r#type.
§Example
ⓘ
use google_cloud_compute_v1::model::resource_commitment::Type;
let x0 = ResourceCommitment::new().set_or_clear_type(Some(Type::LocalSsd));
let x1 = ResourceCommitment::new().set_or_clear_type(Some(Type::Memory));
let x2 = ResourceCommitment::new().set_or_clear_type(Some(Type::Unspecified));
let x_none = ResourceCommitment::new().set_or_clear_type(None::<Type>);Trait Implementations§
Source§impl Clone for ResourceCommitment
impl Clone for ResourceCommitment
Source§fn clone(&self) -> ResourceCommitment
fn clone(&self) -> ResourceCommitment
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 ResourceCommitment
impl Debug for ResourceCommitment
Source§impl Default for ResourceCommitment
impl Default for ResourceCommitment
Source§fn default() -> ResourceCommitment
fn default() -> ResourceCommitment
Returns the “default value” for a type. Read more
Source§impl Message for ResourceCommitment
impl Message for ResourceCommitment
Source§impl PartialEq for ResourceCommitment
impl PartialEq for ResourceCommitment
impl StructuralPartialEq for ResourceCommitment
Auto Trait Implementations§
impl Freeze for ResourceCommitment
impl RefUnwindSafe for ResourceCommitment
impl Send for ResourceCommitment
impl Sync for ResourceCommitment
impl Unpin for ResourceCommitment
impl UnwindSafe for ResourceCommitment
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