#[non_exhaustive]pub struct QueuedResource {
pub name: String,
pub create_time: Option<Timestamp>,
pub queueing_policy: Option<QueueingPolicy>,
pub state: Option<QueuedResourceState>,
pub reservation_name: String,
pub resource: Option<Resource>,
pub tier: Option<Tier>,
/* private fields */
}Expand description
A QueuedResource represents a request for resources that will be placed in a queue and fulfilled when the necessary resources are available.
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.name: StringOutput only. Immutable. The name of the QueuedResource.
create_time: Option<Timestamp>Output only. The time when the QueuedResource was created.
queueing_policy: Option<QueueingPolicy>Optional. The queueing policy of the QueuedRequest.
state: Option<QueuedResourceState>Output only. State of the QueuedResource request.
reservation_name: StringOptional. Name of the reservation in which the resource should be provisioned. Format: projects/{project}/locations/{zone}/reservations/{reservation}
resource: Option<Resource>Resource specification.
tier: Option<Tier>Tier specifies the required tier.
Implementations§
Source§impl QueuedResource
impl QueuedResource
pub fn new() -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = QueuedResource::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = QueuedResource::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = QueuedResource::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_queueing_policy<T>(self, v: T) -> Selfwhere
T: Into<QueueingPolicy>,
pub fn set_queueing_policy<T>(self, v: T) -> Selfwhere
T: Into<QueueingPolicy>,
Sets the value of queueing_policy.
§Example
use google_cloud_tpu_v2::model::queued_resource::QueueingPolicy;
let x = QueuedResource::new().set_queueing_policy(QueueingPolicy::default()/* use setters */);Sourcepub fn set_or_clear_queueing_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueueingPolicy>,
pub fn set_or_clear_queueing_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueueingPolicy>,
Sets or clears the value of queueing_policy.
§Example
use google_cloud_tpu_v2::model::queued_resource::QueueingPolicy;
let x = QueuedResource::new().set_or_clear_queueing_policy(Some(QueueingPolicy::default()/* use setters */));
let x = QueuedResource::new().set_or_clear_queueing_policy(None::<QueueingPolicy>);Sourcepub fn set_state<T>(self, v: T) -> Selfwhere
T: Into<QueuedResourceState>,
pub fn set_state<T>(self, v: T) -> Selfwhere
T: Into<QueuedResourceState>,
Sourcepub fn set_or_clear_state<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueuedResourceState>,
pub fn set_or_clear_state<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueuedResourceState>,
Sourcepub fn set_reservation_name<T: Into<String>>(self, v: T) -> Self
pub fn set_reservation_name<T: Into<String>>(self, v: T) -> Self
Sets the value of reservation_name.
§Example
let x = QueuedResource::new().set_reservation_name("example");Sourcepub fn set_resource<T: Into<Option<Resource>>>(self, v: T) -> Self
pub fn set_resource<T: Into<Option<Resource>>>(self, v: T) -> Self
Sourcepub fn tpu(&self) -> Option<&Box<Tpu>>
pub fn tpu(&self) -> Option<&Box<Tpu>>
The value of resource
if it holds a Tpu, None if the field is not set or
holds a different branch.
Sourcepub fn spot(&self) -> Option<&Box<Spot>>
pub fn spot(&self) -> Option<&Box<Spot>>
The value of tier
if it holds a Spot, None if the field is not set or
holds a different branch.
Sourcepub fn set_spot<T: Into<Box<Spot>>>(self, v: T) -> Self
pub fn set_spot<T: Into<Box<Spot>>>(self, v: T) -> Self
Sets the value of tier
to hold a Spot.
Note that all the setters affecting tier are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource::Spot;
let x = QueuedResource::new().set_spot(Spot::default()/* use setters */);
assert!(x.spot().is_some());
assert!(x.guaranteed().is_none());Sourcepub fn guaranteed(&self) -> Option<&Box<Guaranteed>>
pub fn guaranteed(&self) -> Option<&Box<Guaranteed>>
The value of tier
if it holds a Guaranteed, None if the field is not set or
holds a different branch.
Sourcepub fn set_guaranteed<T: Into<Box<Guaranteed>>>(self, v: T) -> Self
pub fn set_guaranteed<T: Into<Box<Guaranteed>>>(self, v: T) -> Self
Sets the value of tier
to hold a Guaranteed.
Note that all the setters affecting tier are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource::Guaranteed;
let x = QueuedResource::new().set_guaranteed(Guaranteed::default()/* use setters */);
assert!(x.guaranteed().is_some());
assert!(x.spot().is_none());Trait Implementations§
Source§impl Clone for QueuedResource
impl Clone for QueuedResource
Source§fn clone(&self) -> QueuedResource
fn clone(&self) -> QueuedResource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more