Skip to main content

Service

Struct Service 

Source
pub struct Service { /* private fields */ }
Expand description

One application service with ordered attachments and source provenance.

Implementations§

Source§

impl Service

Source

pub const fn new(name: Identifier) -> Self

Creates an empty service shell for incremental adapter mapping.

Source

pub const fn name(&self) -> &Identifier

Returns the service name.

Source

pub fn set_runtime_name(&mut self, name: Sourced<ProtectedString>)

Sets an explicit provider/runtime-level container name distinct from the service key.

Source

pub const fn runtime_name(&self) -> Option<&Sourced<ProtectedString>>

Returns the explicit provider/runtime-level container name.

Source

pub fn set_rootfs( &mut self, rootfs: Sourced<ProtectedString>, ) -> Result<(), ModelError>

Sets a protected root-filesystem path instead of an image source.

§Errors

Returns ModelError::RootfsImageSourceConflict when this service already has an image, image acquisition, or image build reference.

Source

pub const fn rootfs(&self) -> Option<&Sourced<ProtectedString>>

Returns the protected root-filesystem path, if explicitly authored.

Source

pub fn set_image(&mut self, image: Sourced<ImageReference>)

Sets the optional image reference.

Source

pub const fn image(&self) -> Option<&Sourced<ImageReference>>

Returns the optional image reference.

Source

pub fn set_image_acquisition(&mut self, acquisition: Sourced<Identifier>)

References a separately declared image-acquisition resource.

This does not replace Self::image, which remains the runtime container image reference.

Source

pub const fn image_acquisition(&self) -> Option<&Sourced<Identifier>>

Returns the separately declared image-acquisition resource reference.

Source

pub fn set_image_build(&mut self, build: Sourced<Identifier>)

References a separately declared image-build resource.

This does not replace Self::image or any container runtime settings.

Source

pub const fn image_build(&self) -> Option<&Sourced<Identifier>>

Returns the separately declared image-build resource reference.

Source

pub fn set_command(&mut self, command: Sourced<Command>)

Sets the command override.

Source

pub const fn command(&self) -> Option<&Sourced<Command>>

Returns the command override.

Source

pub fn set_startup_notification( &mut self, notification: Sourced<StartupNotification>, )

Sets the source-authored startup-notification behavior.

Source

pub const fn startup_notification( &self, ) -> Option<&Sourced<StartupNotification>>

Returns the explicit startup-notification behavior.

Source

pub fn set_entrypoint(&mut self, entrypoint: Sourced<Entrypoint>)

Sets the entrypoint override independently from the command override.

Source

pub const fn entrypoint(&self) -> Option<&Sourced<Entrypoint>>

Returns the optional entrypoint override.

Source

pub fn set_run_init(&mut self, run_init: Sourced<bool>)

Sets whether the runtime should run its init process.

Source

pub const fn run_init(&self) -> Option<&Sourced<bool>>

Returns the explicit init-process choice.

Source

pub fn set_stop_timeout(&mut self, timeout: Sourced<StopTimeout>)

Sets the raw stop-grace duration.

Source

pub const fn stop_timeout(&self) -> Option<&Sourced<StopTimeout>>

Returns the explicit raw stop-grace duration.

Source

pub fn set_pull_policy(&mut self, policy: Sourced<PullPolicy>)

Sets the source-independent image pull intent.

Source

pub const fn pull_policy(&self) -> Option<&Sourced<PullPolicy>>

Returns the explicit image pull intent.

Source

pub fn set_memory_limit(&mut self, limit: Sourced<ProtectedString>)

Sets the raw protected memory-limit spelling.

Source

pub const fn memory_limit(&self) -> Option<&Sourced<ProtectedString>>

Returns the raw protected memory-limit spelling.

Source

pub fn set_exposed_ports(&mut self, ports: Vec<Sourced<ExposedPort>>)

Sets exposed container ports, preserving omission separately from an explicit empty list.

Source

pub fn set_exposed_ports_with_origins( &mut self, ports: Vec<Sourced<ExposedPort>>, origins: Vec<Provenance>, )

Sets exposed container ports and collection-level provenance.

Source

pub fn add_exposed_port(&mut self, port: Sourced<ExposedPort>)

Appends one exposed container port without publishing it to a host.

Source

pub fn exposed_ports(&self) -> Option<&[Sourced<ExposedPort>]>

Returns exposed container ports in authored order, preserving omitted versus explicit-empty state.

Source

pub fn exposed_ports_origins(&self) -> &[Provenance]

Returns collection-level exposed-port provenance.

Source

pub fn set_restart_policy(&mut self, restart_policy: Sourced<RestartPolicy>)

Sets the container-level automatic restart policy.

Source

pub const fn restart_policy(&self) -> Option<&Sourced<RestartPolicy>>

Returns the container-level automatic restart policy.

Source

pub fn set_healthcheck(&mut self, healthcheck: Sourced<Healthcheck>)

Sets the service health-check definition.

Source

pub const fn healthcheck(&self) -> Option<&Sourced<Healthcheck>>

Returns the optional service health-check definition.

Source

pub fn add_label(&mut self, label: Sourced<MetadataLabel>)

Appends one service metadata label while preserving source order and provenance.

Source

pub fn labels(&self) -> &[Sourced<MetadataLabel>]

Returns service metadata labels in source order.

Source

pub fn set_annotations(&mut self, annotations: Vec<Sourced<Annotation>>)

Sets repeatable annotations while preserving omission separately from an explicit empty list.

Source

pub fn add_annotation(&mut self, annotation: Sourced<Annotation>)

Appends one annotation in source order.

Source

pub fn set_annotations_with_origins( &mut self, annotations: Vec<Sourced<Annotation>>, origins: Vec<Provenance>, )

Sets repeatable annotations with collection-level provenance.

Source

pub fn annotations(&self) -> Option<&[Sourced<Annotation>]>

Returns annotations, preserving omitted versus explicit-empty state.

Source

pub fn annotations_origins(&self) -> &[Provenance]

Returns collection-level annotation provenance.

Source

pub fn set_logging(&mut self, logging: Sourced<Logging>)

Sets provider-specific logging intent.

Source

pub const fn logging(&self) -> Option<&Sourced<Logging>>

Returns provider-specific logging intent.

Source

pub fn set_reload_action(&mut self, reload_action: Sourced<ReloadAction>)

Sets the mutually exclusive reload action.

Source

pub const fn reload_action(&self) -> Option<&Sourced<ReloadAction>>

Returns the one explicit reload action, if any.

Source

pub fn set_user(&mut self, user: Sourced<ProtectedString>)

Sets the primary identity used inside the service container.

Source

pub const fn user(&self) -> Option<&Sourced<ProtectedString>>

Returns the primary identity used inside the service container.

Source

pub fn set_group(&mut self, group: Sourced<ProtectedString>)

Sets the primary group used inside the service container.

Source

pub const fn group(&self) -> Option<&Sourced<ProtectedString>>

Returns the primary group used inside the service container.

Source

pub fn set_user_namespace(&mut self, user_namespace: Sourced<ProtectedString>)

Sets the requested user-namespace mode without imposing one runtime’s grammar.

Source

pub const fn user_namespace(&self) -> Option<&Sourced<ProtectedString>>

Returns the raw-preserving user-namespace mode.

Source

pub fn add_supplementary_group(&mut self, group: Sourced<ProtectedString>)

Appends one supplementary group in source order.

Source

pub fn supplementary_groups(&self) -> &[Sourced<ProtectedString>]

Returns supplementary groups in source order.

Source

pub fn set_working_directory( &mut self, working_directory: Sourced<ProtectedString>, )

Sets the working directory inside the service container.

Source

pub const fn working_directory(&self) -> Option<&Sourced<ProtectedString>>

Returns the working directory inside the service container.

Source

pub fn set_read_only_root_filesystem(&mut self, read_only: Sourced<bool>)

Sets the explicit read-only root-filesystem choice.

Source

pub const fn read_only_root_filesystem(&self) -> Option<&Sourced<bool>>

Returns the explicit read-only root-filesystem choice.

Source

pub fn set_hostname(&mut self, hostname: Sourced<ProtectedString>)

Sets the explicit container hostname without inferring namespace ownership.

Source

pub const fn hostname(&self) -> Option<&Sourced<ProtectedString>>

Returns the raw-preserving explicit hostname.

Source

pub fn set_dns_servers_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets ordered DNS servers, preserving omission separately from an explicit empty list.

Source

pub fn set_dns_servers(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets ordered DNS servers without separate collection provenance.

Source

pub fn dns_servers(&self) -> Option<&[Sourced<ProtectedString>]>

Returns ordered DNS servers when explicitly authored.

Source

pub fn dns_servers_origins(&self) -> &[Provenance]

Returns collection provenance for explicitly authored DNS servers.

Source

pub fn set_dns_options_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets ordered DNS resolver options, preserving omission separately from an explicit empty list.

Source

pub fn set_dns_options(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets ordered DNS resolver options without separate collection provenance.

Source

pub fn dns_options(&self) -> Option<&[Sourced<ProtectedString>]>

Returns ordered DNS resolver options when explicitly authored.

Source

pub fn dns_options_origins(&self) -> &[Provenance]

Returns collection provenance for explicitly authored DNS resolver options.

Source

pub fn set_dns_search_domains_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets ordered DNS search domains, preserving omission separately from an explicit empty list.

Source

pub fn set_dns_search_domains(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets ordered DNS search domains without separate collection provenance.

Source

pub fn dns_search_domains(&self) -> Option<&[Sourced<ProtectedString>]>

Returns ordered DNS search domains when explicitly authored.

Source

pub fn dns_search_domains_origins(&self) -> &[Provenance]

Returns collection provenance for explicitly authored DNS search domains.

Source

pub fn set_security_options_with_origins( &mut self, values: Vec<Sourced<SecurityOption>>, origins: Vec<Provenance>, )

Sets ordered security options, preserving omission separately from an explicit empty list.

Source

pub fn set_security_options(&mut self, values: Vec<Sourced<SecurityOption>>)

Sets ordered security options without separate collection provenance.

Source

pub fn security_options(&self) -> Option<&[Sourced<SecurityOption>]>

Returns ordered security options when explicitly authored.

Source

pub fn security_options_origins(&self) -> &[Provenance]

Returns collection provenance for explicitly authored security options.

Source

pub fn set_pids_limit(&mut self, limit: Sourced<ProtectedString>)

Sets the raw process-ID limit spelling.

Source

pub const fn pids_limit(&self) -> Option<&Sourced<ProtectedString>>

Returns the raw process-ID limit spelling.

Source

pub fn set_shm_size(&mut self, size: Sourced<ProtectedString>)

Sets the raw shared-memory size spelling.

Source

pub const fn shm_size(&self) -> Option<&Sourced<ProtectedString>>

Returns the raw shared-memory size spelling.

Source

pub fn set_cap_add(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets the complete ordered capability-add collection; Some([]) retains an explicit reset.

Source

pub fn set_cap_add_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets capability additions with collection-level provenance for an explicit empty/reset value.

Source

pub fn cap_add(&self) -> Option<&[Sourced<ProtectedString>]>

Returns capability additions, preserving omitted versus explicit-empty state.

Source

pub fn cap_add_origins(&self) -> &[Provenance]

Returns the collection-level capability-add provenance.

Source

pub fn set_cap_drop(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets the complete ordered capability-drop collection; Some([]) retains an explicit reset.

Source

pub fn set_cap_drop_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets capability removals with collection-level provenance for an explicit empty/reset value.

Source

pub fn cap_drop(&self) -> Option<&[Sourced<ProtectedString>]>

Returns capability removals, preserving omitted versus explicit-empty state.

Source

pub fn cap_drop_origins(&self) -> &[Provenance]

Returns the collection-level capability-drop provenance.

Source

pub fn set_tmpfs(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets ordered raw temporary-filesystem declarations.

Source

pub fn set_tmpfs_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets temporary filesystems with collection-level provenance.

Source

pub fn tmpfs(&self) -> Option<&[Sourced<ProtectedString>]>

Returns temporary-filesystem declarations, preserving explicit-empty state.

Source

pub fn tmpfs_origins(&self) -> &[Provenance]

Returns collection-level temporary-filesystem provenance.

Source

pub fn set_sysctls(&mut self, values: Vec<Sourced<KernelParameter>>)

Sets ordered raw kernel-parameter assignments.

Source

pub fn set_sysctls_with_origins( &mut self, values: Vec<Sourced<KernelParameter>>, origins: Vec<Provenance>, )

Sets kernel parameters with collection-level provenance.

Source

pub fn sysctls(&self) -> Option<&[Sourced<KernelParameter>]>

Returns kernel-parameter assignments, preserving explicit-empty state.

Source

pub fn sysctls_origins(&self) -> &[Provenance]

Returns collection-level kernel-parameter provenance.

Source

pub fn set_ulimits(&mut self, values: Vec<Sourced<ResourceLimit>>)

Sets ordered resource limits.

Source

pub fn set_ulimits_with_origins( &mut self, values: Vec<Sourced<ResourceLimit>>, origins: Vec<Provenance>, )

Sets resource limits with collection-level provenance.

Source

pub fn ulimits(&self) -> Option<&[Sourced<ResourceLimit>]>

Returns resource limits, preserving explicit-empty state.

Source

pub fn ulimits_origins(&self) -> &[Provenance]

Returns collection-level resource-limit provenance.

Source

pub fn set_devices(&mut self, values: Vec<Sourced<Device>>)

Sets ordered short/long device declarations.

Source

pub fn set_devices_with_origins( &mut self, values: Vec<Sourced<Device>>, origins: Vec<Provenance>, )

Sets devices with collection-level provenance.

Source

pub fn devices(&self) -> Option<&[Sourced<Device>]>

Returns device declarations, preserving explicit-empty state.

Source

pub fn devices_origins(&self) -> &[Provenance]

Returns collection-level device provenance.

Source

pub fn set_stop_signal(&mut self, signal: Sourced<ProtectedString>)

Sets the explicit stop-signal spelling.

Source

pub const fn stop_signal(&self) -> Option<&Sourced<ProtectedString>>

Returns the raw explicit stop-signal spelling.

Source

pub fn set_podman_args(&mut self, values: Vec<Sourced<ProtectedString>>)

Sets ordered source-authored Podman arguments, retaining an explicit empty collection.

Source

pub fn set_podman_args_with_origins( &mut self, values: Vec<Sourced<ProtectedString>>, origins: Vec<Provenance>, )

Sets ordered source-authored Podman arguments with collection-level provenance.

Source

pub fn add_podman_arg(&mut self, value: Sourced<ProtectedString>)

Appends one protected source-authored Podman argument in source order.

Source

pub fn podman_args(&self) -> Option<&[Sourced<ProtectedString>]>

Returns source-authored Podman arguments, preserving omitted versus explicit-empty state.

Source

pub fn podman_args_origins(&self) -> &[Provenance]

Returns collection-level Podman-argument provenance.

Source

pub fn add_environment(&mut self, value: Sourced<EnvironmentVariable>)

Appends an environment entry.

Source

pub fn environment(&self) -> &[Sourced<EnvironmentVariable>]

Returns environment entries in authored order.

Source

pub fn add_environment_file(&mut self, value: Sourced<EnvironmentFile>)

Appends an environment-file declaration without reading the referenced file.

Source

pub fn environment_files(&self) -> &[Sourced<EnvironmentFile>]

Returns environment-file declarations in authored order.

Source

pub fn add_host_mapping(&mut self, value: Sourced<HostMapping>)

Appends an explicit hostname-to-address mapping.

Source

pub fn host_mappings(&self) -> &[Sourced<HostMapping>]

Returns explicit host mappings in authored order.

Source

pub fn add_port(&mut self, value: Sourced<Port>)

Appends a port.

Source

pub fn ports(&self) -> &[Sourced<Port>]

Returns ports in authored order.

Source

pub fn add_mount(&mut self, value: Sourced<Mount>)

Appends a storage attachment.

Source

pub fn mounts(&self) -> &[Sourced<Mount>]

Returns storage attachments in authored order.

Source

pub fn add_config_grant(&mut self, value: Sourced<ResourceGrant>)

Appends a configuration grant in source order.

Source

pub fn config_grants(&self) -> &[Sourced<ResourceGrant>]

Returns configuration grants in source order.

Source

pub fn add_secret_grant(&mut self, value: Sourced<ResourceGrant>)

Appends a secret grant in source order.

Source

pub fn secret_grants(&self) -> &[Sourced<ResourceGrant>]

Returns secret grants in source order.

Source

pub fn add_network(&mut self, value: Sourced<NetworkAttachment>)

Appends a network attachment.

Source

pub fn replace_network( &mut self, index: usize, value: Sourced<NetworkAttachment>, ) -> Result<Sourced<NetworkAttachment>, ModelError>

Replaces one existing network attachment without changing authored order.

Returns the previous attachment. This narrow mutation boundary lets importers enrich an attachment only after later native entries establish attachment-scoped details.

§Errors

Returns ModelError::UnknownNetworkAttachmentIndex when index is outside the ordered attachment collection.

Source

pub fn networks(&self) -> &[Sourced<NetworkAttachment>]

Returns network attachments in authored order.

Source

pub fn add_dependency(&mut self, value: Sourced<ServiceDependency>)

Appends a service dependency in source order.

Source

pub fn dependencies(&self) -> &[Sourced<ServiceDependency>]

Returns service dependencies in source order.

Source

pub fn validate_image_source_exclusivity(&self) -> Result<(), ModelError>

Validates that a root filesystem was not combined with any image source.

This is public so adapters that incrementally map services can surface an invalid native combination before inserting it into an Application.

§Errors

Returns ModelError::RootfsImageSourceConflict when both forms are present.

Trait Implementations§

Source§

impl Clone for Service

Source§

fn clone(&self) -> Service

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Service

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Service

Source§

impl PartialEq for Service

Source§

fn eq(&self, other: &Service) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Service

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.