#[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 */
}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: Into<Option<MachineSpec>>>(self, v: T) -> Self
pub fn set_machine_spec<T: Into<Option<MachineSpec>>>(self, v: T) -> Self
Sets the value of machine_spec.
Sourcepub fn set_replica_count<T: Into<i64>>(self, v: T) -> Self
pub fn set_replica_count<T: Into<i64>>(self, v: T) -> Self
Sets the value of replica_count.
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.
Sourcepub fn set_disk_spec<T: Into<Option<DiskSpec>>>(self, v: T) -> Self
pub fn set_disk_spec<T: Into<Option<DiskSpec>>>(self, v: T) -> Self
Sets the value of disk_spec.
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.
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.
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.
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