#[non_exhaustive]pub struct WorkerPoolSpec {
pub machine_spec: Option<MachineSpec>,
pub replica_count: i64,
pub nfs_mounts: Vec<NfsMount>,
pub disk_spec: Option<DiskSpec>,
pub task: Option<Task>,
/* private fields */
}job-service only.Expand description
Represents the spec of a worker pool in a job.
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.machine_spec: Option<MachineSpec>Optional. Immutable. The specification of a single machine.
replica_count: i64Optional. The number of worker replicas to use for this worker pool.
nfs_mounts: Vec<NfsMount>Optional. List of NFS mount spec.
disk_spec: Option<DiskSpec>Disk spec.
task: Option<Task>The custom task to be executed in this worker pool.
Implementations§
Source§impl WorkerPoolSpec
impl WorkerPoolSpec
pub fn new() -> Self
Sourcepub fn set_machine_spec<T>(self, v: T) -> Selfwhere
T: Into<MachineSpec>,
pub fn set_machine_spec<T>(self, v: T) -> Selfwhere
T: Into<MachineSpec>,
Sets the value of machine_spec.
§Example
use google_cloud_aiplatform_v1::model::MachineSpec;
let x = WorkerPoolSpec::new().set_machine_spec(MachineSpec::default()/* use setters */);Sourcepub fn set_or_clear_machine_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<MachineSpec>,
pub fn set_or_clear_machine_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<MachineSpec>,
Sets or clears the value of machine_spec.
§Example
use google_cloud_aiplatform_v1::model::MachineSpec;
let x = WorkerPoolSpec::new().set_or_clear_machine_spec(Some(MachineSpec::default()/* use setters */));
let x = WorkerPoolSpec::new().set_or_clear_machine_spec(None::<MachineSpec>);Sourcepub fn set_replica_count<T: Into<i64>>(self, v: T) -> Self
pub fn set_replica_count<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn set_nfs_mounts<T, V>(self, v: T) -> Self
pub fn set_nfs_mounts<T, V>(self, v: T) -> Self
Sets the value of nfs_mounts.
§Example
use google_cloud_aiplatform_v1::model::NfsMount;
let x = WorkerPoolSpec::new()
.set_nfs_mounts([
NfsMount::default()/* use setters */,
NfsMount::default()/* use (different) setters */,
]);Sourcepub fn set_disk_spec<T>(self, v: T) -> Self
pub fn set_disk_spec<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_disk_spec<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_disk_spec<T>(self, v: Option<T>) -> Self
Sourcepub fn set_task<T: Into<Option<Task>>>(self, v: T) -> Self
pub fn set_task<T: Into<Option<Task>>>(self, v: T) -> Self
Sets the value of task.
Note that all the setters affecting task are mutually
exclusive.
§Example
use google_cloud_aiplatform_v1::model::ContainerSpec;
let x = WorkerPoolSpec::new().set_task(Some(
google_cloud_aiplatform_v1::model::worker_pool_spec::Task::ContainerSpec(ContainerSpec::default().into())));Sourcepub fn container_spec(&self) -> Option<&Box<ContainerSpec>>
pub fn container_spec(&self) -> Option<&Box<ContainerSpec>>
The value of task
if it holds a ContainerSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_container_spec<T: Into<Box<ContainerSpec>>>(self, v: T) -> Self
pub fn set_container_spec<T: Into<Box<ContainerSpec>>>(self, v: T) -> Self
Sets the value of task
to hold a ContainerSpec.
Note that all the setters affecting task are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::ContainerSpec;
let x = WorkerPoolSpec::new().set_container_spec(ContainerSpec::default()/* use setters */);
assert!(x.container_spec().is_some());
assert!(x.python_package_spec().is_none());Sourcepub fn python_package_spec(&self) -> Option<&Box<PythonPackageSpec>>
pub fn python_package_spec(&self) -> Option<&Box<PythonPackageSpec>>
The value of task
if it holds a PythonPackageSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_python_package_spec<T: Into<Box<PythonPackageSpec>>>(
self,
v: T,
) -> Self
pub fn set_python_package_spec<T: Into<Box<PythonPackageSpec>>>( self, v: T, ) -> Self
Sets the value of task
to hold a PythonPackageSpec.
Note that all the setters affecting task are
mutually exclusive.
§Example
use google_cloud_aiplatform_v1::model::PythonPackageSpec;
let x = WorkerPoolSpec::new().set_python_package_spec(PythonPackageSpec::default()/* use setters */);
assert!(x.python_package_spec().is_some());
assert!(x.container_spec().is_none());Trait Implementations§
Source§impl Clone for WorkerPoolSpec
impl Clone for WorkerPoolSpec
Source§fn clone(&self) -> WorkerPoolSpec
fn clone(&self) -> WorkerPoolSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more