#[non_exhaustive]pub struct AcceleratorConfig {
pub accelerator_count: Option<i32>,
pub accelerator_type: Option<String>,
/* private fields */
}Available on crate features
future-reservations or instance-templates or instances or machine-images or node-groups or node-templates or region-commitments or region-instance-templates or region-instances or reservations only.Expand description
A specification of the type and number of accelerator cards attached to the instance.
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_count: Option<i32>The number of the guest accelerator cards exposed to this instance.
accelerator_type: Option<String>Full or partial URL of the accelerator type resource to attach to this instance. For example:projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
Implementations§
Source§impl AcceleratorConfig
impl AcceleratorConfig
pub fn new() -> Self
Sourcepub fn set_accelerator_count<T>(self, v: T) -> Self
pub fn set_accelerator_count<T>(self, v: T) -> Self
Sets the value of accelerator_count.
§Example
ⓘ
let x = AcceleratorConfig::new().set_accelerator_count(42);Sourcepub fn set_or_clear_accelerator_count<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_accelerator_count<T>(self, v: Option<T>) -> Self
Sets or clears the value of accelerator_count.
§Example
ⓘ
let x = AcceleratorConfig::new().set_or_clear_accelerator_count(Some(42));
let x = AcceleratorConfig::new().set_or_clear_accelerator_count(None::<i32>);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 = AcceleratorConfig::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 = AcceleratorConfig::new().set_or_clear_accelerator_type(Some("example"));
let x = AcceleratorConfig::new().set_or_clear_accelerator_type(None::<String>);Trait Implementations§
Source§impl Clone for AcceleratorConfig
impl Clone for AcceleratorConfig
Source§fn clone(&self) -> AcceleratorConfig
fn clone(&self) -> AcceleratorConfig
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 AcceleratorConfig
impl Debug for AcceleratorConfig
Source§impl Default for AcceleratorConfig
impl Default for AcceleratorConfig
Source§fn default() -> AcceleratorConfig
fn default() -> AcceleratorConfig
Returns the “default value” for a type. Read more
Source§impl Message for AcceleratorConfig
impl Message for AcceleratorConfig
Source§impl PartialEq for AcceleratorConfig
impl PartialEq for AcceleratorConfig
impl StructuralPartialEq for AcceleratorConfig
Auto Trait Implementations§
impl Freeze for AcceleratorConfig
impl RefUnwindSafe for AcceleratorConfig
impl Send for AcceleratorConfig
impl Sync for AcceleratorConfig
impl Unpin for AcceleratorConfig
impl UnwindSafe for AcceleratorConfig
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