pub struct Volume { /* private fields */ }Expand description
One application-level volume declaration.
Implementations§
Source§impl Volume
impl Volume
Sourcepub const fn new(name: Identifier, ownership: ResourceOwnership) -> Volume
pub const fn new(name: Identifier, ownership: ResourceOwnership) -> Volume
Creates a volume declaration without inferring native defaults or names.
Sourcepub const fn name(&self) -> &Identifier
pub const fn name(&self) -> &Identifier
Returns the neutral resource name.
Sourcepub const fn ownership(&self) -> ResourceOwnership
pub const fn ownership(&self) -> ResourceOwnership
Returns the resource lifecycle owner.
Sourcepub fn set_runtime_name(&mut self, name: Sourced<ProtectedString>)
pub fn set_runtime_name(&mut self, name: Sourced<ProtectedString>)
Sets the explicit runtime name, distinct from the logical resource key.
Sourcepub const fn runtime_name(&self) -> Option<&Sourced<ProtectedString>>
pub const fn runtime_name(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicit provider/runtime name.
Sourcepub fn set_service_name(&mut self, name: Sourced<ProtectedString>)
pub fn set_service_name(&mut self, name: Sourced<ProtectedString>)
Sets the explicit service-manager unit name without changing its spelling.
Sourcepub const fn service_name(&self) -> Option<&Sourced<ProtectedString>>
pub const fn service_name(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicit service-manager unit name.
Sourcepub fn set_driver(&mut self, driver: Sourced<ProtectedString>)
pub fn set_driver(&mut self, driver: Sourced<ProtectedString>)
Sets the source-authored volume driver spelling.
Sourcepub const fn driver(&self) -> Option<&Sourced<ProtectedString>>
pub const fn driver(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicit volume driver spelling.
Sourcepub fn set_device(&mut self, device: Sourced<ProtectedString>)
pub fn set_device(&mut self, device: Sourced<ProtectedString>)
Sets the source-authored local-driver device spelling.
Sourcepub const fn device(&self) -> Option<&Sourced<ProtectedString>>
pub const fn device(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicit local-driver device spelling.
Sourcepub fn set_volume_type(&mut self, volume_type: Sourced<ProtectedString>)
pub fn set_volume_type(&mut self, volume_type: Sourced<ProtectedString>)
Sets the source-authored local-driver type spelling.
Sourcepub const fn volume_type(&self) -> Option<&Sourced<ProtectedString>>
pub const fn volume_type(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicit local-driver type spelling.
Sourcepub fn set_options(&mut self, options: Sourced<ProtectedString>)
pub fn set_options(&mut self, options: Sourced<ProtectedString>)
Sets the explicit singleton local-driver options spelling.
This is intentionally not a generic option bag: it retains the reviewed Options=
setting, including the Compose local-driver driver_opts.o mapping.
Sourcepub const fn options(&self) -> Option<&Sourced<ProtectedString>>
pub const fn options(&self) -> Option<&Sourced<ProtectedString>>
Returns the explicit singleton local-driver options spelling.
Sourcepub fn set_labels(&mut self, labels: Vec<Sourced<MetadataLabel>>)
pub fn set_labels(&mut self, labels: Vec<Sourced<MetadataLabel>>)
Sets metadata labels, retaining omission separately from an explicit empty reset.
Sourcepub fn set_labels_with_origins(
&mut self,
labels: Vec<Sourced<MetadataLabel>>,
origins: Vec<Provenance>,
)
pub fn set_labels_with_origins( &mut self, labels: Vec<Sourced<MetadataLabel>>, origins: Vec<Provenance>, )
Sets metadata labels with collection-level provenance.
Sourcepub fn add_label(&mut self, label: Sourced<MetadataLabel>)
pub fn add_label(&mut self, label: Sourced<MetadataLabel>)
Appends one metadata label in source order.
Sourcepub fn labels(&self) -> Option<&[Sourced<MetadataLabel>]>
pub fn labels(&self) -> Option<&[Sourced<MetadataLabel>]>
Returns metadata labels in authored order, preserving omitted versus explicit-empty state.
Sourcepub fn labels_origins(&self) -> &[Provenance]
pub fn labels_origins(&self) -> &[Provenance]
Returns collection-level label provenance.
Sourcepub fn set_copy(&mut self, copy: Sourced<bool>)
pub fn set_copy(&mut self, copy: Sourced<bool>)
Sets the explicit copy choice without inferring an omitted source default.
Sourcepub fn set_user(&mut self, user: Sourced<ProtectedString>)
pub fn set_user(&mut self, user: Sourced<ProtectedString>)
Sets the source-authored volume user identity.
Sourcepub const fn user(&self) -> Option<&Sourced<ProtectedString>>
pub const fn user(&self) -> Option<&Sourced<ProtectedString>>
Returns the source-authored volume user identity.
Sourcepub fn set_group(&mut self, group: Sourced<ProtectedString>)
pub fn set_group(&mut self, group: Sourced<ProtectedString>)
Sets the source-authored volume group identity.
Sourcepub const fn group(&self) -> Option<&Sourced<ProtectedString>>
pub const fn group(&self) -> Option<&Sourced<ProtectedString>>
Returns the source-authored volume group identity.
Sourcepub fn set_uid(&mut self, uid: Sourced<ProtectedString>)
pub fn set_uid(&mut self, uid: Sourced<ProtectedString>)
Sets the source-authored numeric user-ID spelling.
Sourcepub const fn uid(&self) -> Option<&Sourced<ProtectedString>>
pub const fn uid(&self) -> Option<&Sourced<ProtectedString>>
Returns the source-authored numeric user-ID spelling.
Sourcepub fn set_gid(&mut self, gid: Sourced<ProtectedString>)
pub fn set_gid(&mut self, gid: Sourced<ProtectedString>)
Sets the source-authored numeric group-ID spelling.
Sourcepub const fn gid(&self) -> Option<&Sourced<ProtectedString>>
pub const fn gid(&self) -> Option<&Sourced<ProtectedString>>
Returns the source-authored numeric group-ID spelling.
Sourcepub fn set_image_source(
&mut self,
image_source: Sourced<VolumeImageSource>,
) -> Result<(), ModelError>
pub fn set_image_source( &mut self, image_source: Sourced<VolumeImageSource>, ) -> Result<(), ModelError>
Sets the explicitly selected image source for an image-backed volume.
Artifact references are checked by Application::validate_image_artifact_references
after a complete application graph has been assembled.
§Errors
Returns ModelError::EmptyValue or ModelError::ContainsNul for an invalid literal
image source.
Sourcepub const fn image_source(&self) -> Option<&Sourced<VolumeImageSource>>
pub const fn image_source(&self) -> Option<&Sourced<VolumeImageSource>>
Returns the explicitly selected image source for an image-backed volume.