#[non_exhaustive]pub struct ReplicaComputeCapacity {
pub replica_selection: Option<ReplicaSelection>,
pub compute_capacity: Option<ComputeCapacity>,
/* private fields */
}Expand description
ReplicaComputeCapacity describes the amount of server resources that are allocated to each replica identified by the replica selection.
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.replica_selection: Option<ReplicaSelection>Required. Identifies replicas by specified properties. All replicas in the selection have the same amount of compute capacity.
compute_capacity: Option<ComputeCapacity>Compute capacity allocated to each replica identified by the specified selection. The unit is selected based on the unit used to specify the instance size for non-autoscaling instances, or the unit used in autoscaling limit for autoscaling instances.
Implementations§
Source§impl ReplicaComputeCapacity
impl ReplicaComputeCapacity
pub fn new() -> Self
Sourcepub fn set_replica_selection<T>(self, v: T) -> Selfwhere
T: Into<ReplicaSelection>,
pub fn set_replica_selection<T>(self, v: T) -> Selfwhere
T: Into<ReplicaSelection>,
Sets the value of replica_selection.
§Example
use google_cloud_spanner_admin_instance_v1::model::ReplicaSelection;
let x = ReplicaComputeCapacity::new().set_replica_selection(ReplicaSelection::default()/* use setters */);Sourcepub fn set_or_clear_replica_selection<T>(self, v: Option<T>) -> Selfwhere
T: Into<ReplicaSelection>,
pub fn set_or_clear_replica_selection<T>(self, v: Option<T>) -> Selfwhere
T: Into<ReplicaSelection>,
Sets or clears the value of replica_selection.
§Example
use google_cloud_spanner_admin_instance_v1::model::ReplicaSelection;
let x = ReplicaComputeCapacity::new().set_or_clear_replica_selection(Some(ReplicaSelection::default()/* use setters */));
let x = ReplicaComputeCapacity::new().set_or_clear_replica_selection(None::<ReplicaSelection>);Sourcepub fn set_compute_capacity<T: Into<Option<ComputeCapacity>>>(
self,
v: T,
) -> Self
pub fn set_compute_capacity<T: Into<Option<ComputeCapacity>>>( self, v: T, ) -> Self
Sets the value of compute_capacity.
Note that all the setters affecting compute_capacity are mutually
exclusive.
§Example
use google_cloud_spanner_admin_instance_v1::model::replica_compute_capacity::ComputeCapacity;
let x = ReplicaComputeCapacity::new().set_compute_capacity(Some(ComputeCapacity::NodeCount(42)));Sourcepub fn node_count(&self) -> Option<&i32>
pub fn node_count(&self) -> Option<&i32>
The value of compute_capacity
if it holds a NodeCount, None if the field is not set or
holds a different branch.
Sourcepub fn set_node_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_node_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of compute_capacity
to hold a NodeCount.
Note that all the setters affecting compute_capacity are
mutually exclusive.
§Example
let x = ReplicaComputeCapacity::new().set_node_count(42);
assert!(x.node_count().is_some());
assert!(x.processing_units().is_none());Sourcepub fn processing_units(&self) -> Option<&i32>
pub fn processing_units(&self) -> Option<&i32>
The value of compute_capacity
if it holds a ProcessingUnits, None if the field is not set or
holds a different branch.
Sourcepub fn set_processing_units<T: Into<i32>>(self, v: T) -> Self
pub fn set_processing_units<T: Into<i32>>(self, v: T) -> Self
Sets the value of compute_capacity
to hold a ProcessingUnits.
Note that all the setters affecting compute_capacity are
mutually exclusive.
§Example
let x = ReplicaComputeCapacity::new().set_processing_units(42);
assert!(x.processing_units().is_some());
assert!(x.node_count().is_none());Trait Implementations§
Source§impl Clone for ReplicaComputeCapacity
impl Clone for ReplicaComputeCapacity
Source§fn clone(&self) -> ReplicaComputeCapacity
fn clone(&self) -> ReplicaComputeCapacity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more