#[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
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());Trait Implementations§
impl StructuralPartialEq for Volume
Auto Trait Implementations§
impl Freeze for Volume
impl RefUnwindSafe for Volume
impl Send for Volume
impl Sync for Volume
impl Unpin for Volume
impl UnsafeUnpin for Volume
impl UnwindSafe for Volume
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