#[non_exhaustive]pub struct QueuedResourceState {
pub state: State,
pub state_initiator: StateInitiator,
pub state_data: Option<StateData>,
/* private fields */
}Expand description
QueuedResourceState defines the details of the QueuedResource request.
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.state: StateOutput only. State of the QueuedResource request.
state_initiator: StateInitiatorOutput only. The initiator of the QueuedResources’s current state. Used to indicate whether the SUSPENDING/SUSPENDED state was initiated by the user or the service.
state_data: Option<StateData>Further data for the state.
Implementations§
Source§impl QueuedResourceState
impl QueuedResourceState
pub fn new() -> Self
Sourcepub fn set_state_initiator<T: Into<StateInitiator>>(self, v: T) -> Self
pub fn set_state_initiator<T: Into<StateInitiator>>(self, v: T) -> Self
Sets the value of state_initiator.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::StateInitiator;
let x0 = QueuedResourceState::new().set_state_initiator(StateInitiator::User);
let x1 = QueuedResourceState::new().set_state_initiator(StateInitiator::Service);Sourcepub fn set_state_data<T: Into<Option<StateData>>>(self, v: T) -> Self
pub fn set_state_data<T: Into<Option<StateData>>>(self, v: T) -> Self
Sets the value of state_data.
Note that all the setters affecting state_data are mutually
exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::CreatingData;
let x = QueuedResourceState::new().set_state_data(Some(
google_cloud_tpu_v2::model::queued_resource_state::StateData::CreatingData(CreatingData::default().into())));Sourcepub fn creating_data(&self) -> Option<&Box<CreatingData>>
pub fn creating_data(&self) -> Option<&Box<CreatingData>>
The value of state_data
if it holds a CreatingData, None if the field is not set or
holds a different branch.
Sourcepub fn set_creating_data<T: Into<Box<CreatingData>>>(self, v: T) -> Self
pub fn set_creating_data<T: Into<Box<CreatingData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a CreatingData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::CreatingData;
let x = QueuedResourceState::new().set_creating_data(CreatingData::default()/* use setters */);
assert!(x.creating_data().is_some());
assert!(x.accepted_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspending_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn accepted_data(&self) -> Option<&Box<AcceptedData>>
pub fn accepted_data(&self) -> Option<&Box<AcceptedData>>
The value of state_data
if it holds a AcceptedData, None if the field is not set or
holds a different branch.
Sourcepub fn set_accepted_data<T: Into<Box<AcceptedData>>>(self, v: T) -> Self
pub fn set_accepted_data<T: Into<Box<AcceptedData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a AcceptedData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::AcceptedData;
let x = QueuedResourceState::new().set_accepted_data(AcceptedData::default()/* use setters */);
assert!(x.accepted_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspending_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn provisioning_data(&self) -> Option<&Box<ProvisioningData>>
pub fn provisioning_data(&self) -> Option<&Box<ProvisioningData>>
The value of state_data
if it holds a ProvisioningData, None if the field is not set or
holds a different branch.
Sourcepub fn set_provisioning_data<T: Into<Box<ProvisioningData>>>(self, v: T) -> Self
pub fn set_provisioning_data<T: Into<Box<ProvisioningData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a ProvisioningData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::ProvisioningData;
let x = QueuedResourceState::new().set_provisioning_data(ProvisioningData::default()/* use setters */);
assert!(x.provisioning_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.accepted_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspending_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn failed_data(&self) -> Option<&Box<FailedData>>
pub fn failed_data(&self) -> Option<&Box<FailedData>>
The value of state_data
if it holds a FailedData, None if the field is not set or
holds a different branch.
Sourcepub fn set_failed_data<T: Into<Box<FailedData>>>(self, v: T) -> Self
pub fn set_failed_data<T: Into<Box<FailedData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a FailedData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::FailedData;
let x = QueuedResourceState::new().set_failed_data(FailedData::default()/* use setters */);
assert!(x.failed_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.accepted_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspending_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn deleting_data(&self) -> Option<&Box<DeletingData>>
pub fn deleting_data(&self) -> Option<&Box<DeletingData>>
The value of state_data
if it holds a DeletingData, None if the field is not set or
holds a different branch.
Sourcepub fn set_deleting_data<T: Into<Box<DeletingData>>>(self, v: T) -> Self
pub fn set_deleting_data<T: Into<Box<DeletingData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a DeletingData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::DeletingData;
let x = QueuedResourceState::new().set_deleting_data(DeletingData::default()/* use setters */);
assert!(x.deleting_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.accepted_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspending_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn active_data(&self) -> Option<&Box<ActiveData>>
pub fn active_data(&self) -> Option<&Box<ActiveData>>
The value of state_data
if it holds a ActiveData, None if the field is not set or
holds a different branch.
Sourcepub fn set_active_data<T: Into<Box<ActiveData>>>(self, v: T) -> Self
pub fn set_active_data<T: Into<Box<ActiveData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a ActiveData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::ActiveData;
let x = QueuedResourceState::new().set_active_data(ActiveData::default()/* use setters */);
assert!(x.active_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.accepted_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.suspending_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn suspending_data(&self) -> Option<&Box<SuspendingData>>
pub fn suspending_data(&self) -> Option<&Box<SuspendingData>>
The value of state_data
if it holds a SuspendingData, None if the field is not set or
holds a different branch.
Sourcepub fn set_suspending_data<T: Into<Box<SuspendingData>>>(self, v: T) -> Self
pub fn set_suspending_data<T: Into<Box<SuspendingData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a SuspendingData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::SuspendingData;
let x = QueuedResourceState::new().set_suspending_data(SuspendingData::default()/* use setters */);
assert!(x.suspending_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.accepted_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspended_data().is_none());Sourcepub fn suspended_data(&self) -> Option<&Box<SuspendedData>>
pub fn suspended_data(&self) -> Option<&Box<SuspendedData>>
The value of state_data
if it holds a SuspendedData, None if the field is not set or
holds a different branch.
Sourcepub fn set_suspended_data<T: Into<Box<SuspendedData>>>(self, v: T) -> Self
pub fn set_suspended_data<T: Into<Box<SuspendedData>>>(self, v: T) -> Self
Sets the value of state_data
to hold a SuspendedData.
Note that all the setters affecting state_data are
mutually exclusive.
§Example
use google_cloud_tpu_v2::model::queued_resource_state::SuspendedData;
let x = QueuedResourceState::new().set_suspended_data(SuspendedData::default()/* use setters */);
assert!(x.suspended_data().is_some());
assert!(x.creating_data().is_none());
assert!(x.accepted_data().is_none());
assert!(x.provisioning_data().is_none());
assert!(x.failed_data().is_none());
assert!(x.deleting_data().is_none());
assert!(x.active_data().is_none());
assert!(x.suspending_data().is_none());Trait Implementations§
Source§impl Clone for QueuedResourceState
impl Clone for QueuedResourceState
Source§fn clone(&self) -> QueuedResourceState
fn clone(&self) -> QueuedResourceState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more