#[non_exhaustive]pub struct WorkerPoolSpec {
pub machine_spec: Option<MachineSpec>,
pub replica_count: i64,
pub nfs_mounts: Vec<NfsMount>,
pub lustre_mounts: Vec<LustreMount>,
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.
lustre_mounts: Vec<LustreMount>Optional. List of Lustre mounts.
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
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_lustre_mounts<T, V>(self, v: T) -> Self
pub fn set_lustre_mounts<T, V>(self, v: T) -> Self
Sets the value of lustre_mounts.
§Example
use google_cloud_aiplatform_v1::model::LustreMount;
let x = WorkerPoolSpec::new()
.set_lustre_mounts([
LustreMount::default()/* use setters */,
LustreMount::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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerPoolSpec
impl Debug for WorkerPoolSpec
Source§impl Default for WorkerPoolSpec
impl Default for WorkerPoolSpec
Source§fn default() -> WorkerPoolSpec
fn default() -> WorkerPoolSpec
Source§impl Message for WorkerPoolSpec
impl Message for WorkerPoolSpec
Source§impl PartialEq for WorkerPoolSpec
impl PartialEq for WorkerPoolSpec
impl StructuralPartialEq for WorkerPoolSpec
Auto Trait Implementations§
impl Freeze for WorkerPoolSpec
impl RefUnwindSafe for WorkerPoolSpec
impl Send for WorkerPoolSpec
impl Sync for WorkerPoolSpec
impl Unpin for WorkerPoolSpec
impl UnsafeUnpin for WorkerPoolSpec
impl UnwindSafe for WorkerPoolSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request