#[non_exhaustive]pub struct Volume {
pub name: String,
pub volume_type: Option<VolumeType>,
/* private fields */
}Expand description
Volume represents a named volume in a container.
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.name: StringRequired. Volume’s name.
volume_type: Option<VolumeType>Implementations§
Source§impl Volume
impl Volume
pub fn new() -> Self
Sourcepub fn set_volume_type<T: Into<Option<VolumeType>>>(self, v: T) -> Self
pub fn set_volume_type<T: Into<Option<VolumeType>>>(self, v: T) -> Self
Sets the value of volume_type.
Note that all the setters affecting volume_type are mutually
exclusive.
§Example
use google_cloud_run_v2::model::SecretVolumeSource;
let x = Volume::new().set_volume_type(Some(
google_cloud_run_v2::model::volume::VolumeType::Secret(SecretVolumeSource::default().into())));Sourcepub fn secret(&self) -> Option<&Box<SecretVolumeSource>>
pub fn secret(&self) -> Option<&Box<SecretVolumeSource>>
The value of volume_type
if it holds a Secret, None if the field is not set or
holds a different branch.
Sourcepub fn set_secret<T: Into<Box<SecretVolumeSource>>>(self, v: T) -> Self
pub fn set_secret<T: Into<Box<SecretVolumeSource>>>(self, v: T) -> Self
Sets the value of volume_type
to hold a Secret.
Note that all the setters affecting volume_type are
mutually exclusive.
§Example
use google_cloud_run_v2::model::SecretVolumeSource;
let x = Volume::new().set_secret(SecretVolumeSource::default()/* use setters */);
assert!(x.secret().is_some());
assert!(x.cloud_sql_instance().is_none());
assert!(x.empty_dir().is_none());
assert!(x.nfs().is_none());
assert!(x.gcs().is_none());Sourcepub fn cloud_sql_instance(&self) -> Option<&Box<CloudSqlInstance>>
pub fn cloud_sql_instance(&self) -> Option<&Box<CloudSqlInstance>>
The value of volume_type
if it holds a CloudSqlInstance, None if the field is not set or
holds a different branch.
Sourcepub fn set_cloud_sql_instance<T: Into<Box<CloudSqlInstance>>>(
self,
v: T,
) -> Self
pub fn set_cloud_sql_instance<T: Into<Box<CloudSqlInstance>>>( self, v: T, ) -> Self
Sets the value of volume_type
to hold a CloudSqlInstance.
Note that all the setters affecting volume_type are
mutually exclusive.
§Example
use google_cloud_run_v2::model::CloudSqlInstance;
let x = Volume::new().set_cloud_sql_instance(CloudSqlInstance::default()/* use setters */);
assert!(x.cloud_sql_instance().is_some());
assert!(x.secret().is_none());
assert!(x.empty_dir().is_none());
assert!(x.nfs().is_none());
assert!(x.gcs().is_none());Sourcepub fn empty_dir(&self) -> Option<&Box<EmptyDirVolumeSource>>
pub fn empty_dir(&self) -> Option<&Box<EmptyDirVolumeSource>>
The value of volume_type
if it holds a EmptyDir, None if the field is not set or
holds a different branch.
Sourcepub fn set_empty_dir<T: Into<Box<EmptyDirVolumeSource>>>(self, v: T) -> Self
pub fn set_empty_dir<T: Into<Box<EmptyDirVolumeSource>>>(self, v: T) -> Self
Sets the value of volume_type
to hold a EmptyDir.
Note that all the setters affecting volume_type are
mutually exclusive.
§Example
use google_cloud_run_v2::model::EmptyDirVolumeSource;
let x = Volume::new().set_empty_dir(EmptyDirVolumeSource::default()/* use setters */);
assert!(x.empty_dir().is_some());
assert!(x.secret().is_none());
assert!(x.cloud_sql_instance().is_none());
assert!(x.nfs().is_none());
assert!(x.gcs().is_none());Sourcepub fn nfs(&self) -> Option<&Box<NFSVolumeSource>>
pub fn nfs(&self) -> Option<&Box<NFSVolumeSource>>
The value of volume_type
if it holds a Nfs, None if the field is not set or
holds a different branch.
Sourcepub fn set_nfs<T: Into<Box<NFSVolumeSource>>>(self, v: T) -> Self
pub fn set_nfs<T: Into<Box<NFSVolumeSource>>>(self, v: T) -> Self
Sets the value of volume_type
to hold a Nfs.
Note that all the setters affecting volume_type are
mutually exclusive.
§Example
use google_cloud_run_v2::model::NFSVolumeSource;
let x = Volume::new().set_nfs(NFSVolumeSource::default()/* use setters */);
assert!(x.nfs().is_some());
assert!(x.secret().is_none());
assert!(x.cloud_sql_instance().is_none());
assert!(x.empty_dir().is_none());
assert!(x.gcs().is_none());Sourcepub fn gcs(&self) -> Option<&Box<GCSVolumeSource>>
pub fn gcs(&self) -> Option<&Box<GCSVolumeSource>>
The value of volume_type
if it holds a Gcs, None if the field is not set or
holds a different branch.
Sourcepub fn set_gcs<T: Into<Box<GCSVolumeSource>>>(self, v: T) -> Self
pub fn set_gcs<T: Into<Box<GCSVolumeSource>>>(self, v: T) -> Self
Sets the value of volume_type
to hold a Gcs.
Note that all the setters affecting volume_type are
mutually exclusive.
§Example
use google_cloud_run_v2::model::GCSVolumeSource;
let x = Volume::new().set_gcs(GCSVolumeSource::default()/* use setters */);
assert!(x.gcs().is_some());
assert!(x.secret().is_none());
assert!(x.cloud_sql_instance().is_none());
assert!(x.empty_dir().is_none());
assert!(x.nfs().is_none());