#[non_exhaustive]pub struct ReservationAffinity {
pub consume_reservation_type: Option<ConsumeReservationType>,
pub key: Option<String>,
pub values: Vec<String>,
/* private fields */
}instance-templates or instances or machine-images or region-instance-templates or region-instances only.Expand description
Specifies the reservations that this instance can consume from.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.consume_reservation_type: Option<ConsumeReservationType>Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default),SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples.
key: Option<String>Corresponds to the label key of a reservation resource. To target aSPECIFIC_RESERVATION by name, specifygoogleapis.com/reservation-name as the key and specify the name of your reservation as its value.
values: Vec<String>Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or “projects/different-project/reservations/some-reservation-name” to target a shared reservation in the same zone but in a different project.
Implementations§
Source§impl ReservationAffinity
impl ReservationAffinity
Sourcepub fn set_consume_reservation_type<T>(self, v: T) -> Selfwhere
T: Into<ConsumeReservationType>,
pub fn set_consume_reservation_type<T>(self, v: T) -> Selfwhere
T: Into<ConsumeReservationType>,
Sets the value of consume_reservation_type.
§Example
use google_cloud_compute_v1::model::reservation_affinity::ConsumeReservationType;
let x0 = ReservationAffinity::new().set_consume_reservation_type(ConsumeReservationType::NoReservation);
let x1 = ReservationAffinity::new().set_consume_reservation_type(ConsumeReservationType::SpecificReservation);
let x2 = ReservationAffinity::new().set_consume_reservation_type(ConsumeReservationType::Unspecified);Sourcepub fn set_or_clear_consume_reservation_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConsumeReservationType>,
pub fn set_or_clear_consume_reservation_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConsumeReservationType>,
Sets or clears the value of consume_reservation_type.
§Example
use google_cloud_compute_v1::model::reservation_affinity::ConsumeReservationType;
let x0 = ReservationAffinity::new().set_or_clear_consume_reservation_type(Some(ConsumeReservationType::NoReservation));
let x1 = ReservationAffinity::new().set_or_clear_consume_reservation_type(Some(ConsumeReservationType::SpecificReservation));
let x2 = ReservationAffinity::new().set_or_clear_consume_reservation_type(Some(ConsumeReservationType::Unspecified));
let x_none = ReservationAffinity::new().set_or_clear_consume_reservation_type(None::<ConsumeReservationType>);Sourcepub fn set_or_clear_key<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_key<T>(self, v: Option<T>) -> Self
Sourcepub fn set_values<T, V>(self, v: T) -> Self
pub fn set_values<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for ReservationAffinity
impl Clone for ReservationAffinity
Source§fn clone(&self) -> ReservationAffinity
fn clone(&self) -> ReservationAffinity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReservationAffinity
impl Debug for ReservationAffinity
Source§impl Default for ReservationAffinity
impl Default for ReservationAffinity
Source§fn default() -> ReservationAffinity
fn default() -> ReservationAffinity
Source§impl Message for ReservationAffinity
impl Message for ReservationAffinity
Source§impl PartialEq for ReservationAffinity
impl PartialEq for ReservationAffinity
impl StructuralPartialEq for ReservationAffinity
Auto Trait Implementations§
impl Freeze for ReservationAffinity
impl RefUnwindSafe for ReservationAffinity
impl Send for ReservationAffinity
impl Sync for ReservationAffinity
impl Unpin for ReservationAffinity
impl UnsafeUnpin for ReservationAffinity
impl UnwindSafe for ReservationAffinity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request