pub struct Service { /* private fields */ }Expand description
A source-aware typed Compose service.
Implementations§
Source§impl Service
impl Service
Sourcepub const fn span(&self) -> SourceSpan
pub const fn span(&self) -> SourceSpan
Returns the complete service definition span.
Sourcepub const fn hostname(&self) -> Option<&Hostname>
pub const fn hostname(&self) -> Option<&Hostname>
Returns the explicitly authored raw-preserving service hostname.
Sourcepub const fn container_name(&self) -> Option<&Located<String>>
pub const fn container_name(&self) -> Option<&Located<String>>
Returns the explicitly authored runtime container name.
Sourcepub const fn image(&self) -> Option<&Located<ImageReference>>
pub const fn image(&self) -> Option<&Located<ImageReference>>
Returns the explicitly authored image reference.
Sourcepub const fn platform(&self) -> Option<&Located<String>>
pub const fn platform(&self) -> Option<&Located<String>>
Returns the strict raw service platform string without OCI interpretation.
Sourcepub const fn entrypoint(&self) -> Option<&Entrypoint>
pub const fn entrypoint(&self) -> Option<&Entrypoint>
Returns the entrypoint without normalizing its authored form.
Sourcepub const fn command(&self) -> Option<&Command>
pub const fn command(&self) -> Option<&Command>
Returns the command without normalizing its authored form.
Sourcepub const fn credential_spec(&self) -> Option<&CredentialSpec>
pub const fn credential_spec(&self) -> Option<&CredentialSpec>
Returns the authored credential-spec mapping without resolving its references.
Sourcepub const fn extends(&self) -> Option<&Extends>
pub const fn extends(&self) -> Option<&Extends>
Returns the authored raw extends directive without resolving its reference.
Sourcepub const fn provider(&self) -> Option<&Provider>
pub const fn provider(&self) -> Option<&Provider>
Returns the authored provider configuration without provider execution or discovery.
Sourcepub const fn post_start(&self) -> Option<&PostStartHooks>
pub const fn post_start(&self) -> Option<&PostStartHooks>
Returns ordered post-start hooks without executing them or inferring lifecycle behavior.
Sourcepub const fn pre_stop(&self) -> Option<&PreStopHooks>
pub const fn pre_stop(&self) -> Option<&PreStopHooks>
Returns ordered pre-stop hooks without executing them or inferring lifecycle behavior.
Sourcepub const fn pre_start(&self) -> Option<&PreStartHooks>
pub const fn pre_start(&self) -> Option<&PreStartHooks>
Returns ordered pre-start hooks without executing them or inferring lifecycle behavior.
Sourcepub const fn blkio_config(&self) -> Option<&BlkioConfig>
pub const fn blkio_config(&self) -> Option<&BlkioConfig>
Returns authored block-I/O configuration without controller or runtime interpretation.
Sourcepub const fn cgroup(&self) -> Option<&CgroupNamespace>
pub const fn cgroup(&self) -> Option<&CgroupNamespace>
Returns the authored cgroup namespace without controller or runtime interpretation.
Sourcepub const fn cgroup_parent(&self) -> Option<&Located<String>>
pub const fn cgroup_parent(&self) -> Option<&Located<String>>
Returns the authored raw cgroup parent string without path or runtime interpretation.
Sourcepub const fn runtime(&self) -> Option<&Located<String>>
pub const fn runtime(&self) -> Option<&Located<String>>
Returns the strict raw service runtime string without runtime interpretation.
Sourcepub const fn pull_refresh_after(&self) -> Option<&Located<String>>
pub const fn pull_refresh_after(&self) -> Option<&Located<String>>
Returns the strict raw service pull-refresh interval without refresh interpretation.
Sourcepub const fn attach(&self) -> Option<&Located<BooleanValue>>
pub const fn attach(&self) -> Option<&Located<BooleanValue>>
Returns the authored attach choice without runtime interpretation.
Sourcepub const fn init(&self) -> Option<&Located<BooleanValue>>
pub const fn init(&self) -> Option<&Located<BooleanValue>>
Returns whether Compose should run its platform-specific init process.
Sourcepub const fn stdin_open(&self) -> Option<&Located<BooleanValue>>
pub const fn stdin_open(&self) -> Option<&Located<BooleanValue>>
Returns whether Compose should keep standard input open for the service.
Sourcepub const fn tty(&self) -> Option<&Located<BooleanValue>>
pub const fn tty(&self) -> Option<&Located<BooleanValue>>
Returns whether Compose should allocate a terminal for the service.
Sourcepub const fn privileged(&self) -> Option<&Located<BooleanValue>>
pub const fn privileged(&self) -> Option<&Located<BooleanValue>>
Returns whether Compose should run the service with its privileged choice.
Sourcepub const fn environment(&self) -> Option<&Environment>
pub const fn environment(&self) -> Option<&Environment>
Returns environment variables with list and mapping forms kept distinct.
Sourcepub fn environment_files(&self) -> &[EnvironmentFile]
pub fn environment_files(&self) -> &[EnvironmentFile]
Returns service environment files in authored order with syntax retained.
Sourcepub const fn labels(&self) -> Option<&Labels>
pub const fn labels(&self) -> Option<&Labels>
Returns service metadata labels with list and mapping forms kept distinct.
Sourcepub const fn annotations(&self) -> Option<&Annotations>
pub const fn annotations(&self) -> Option<&Annotations>
Returns service annotations with list and mapping forms kept distinct.
Sourcepub const fn extra_hosts(&self) -> Option<&ExtraHosts>
pub const fn extra_hosts(&self) -> Option<&ExtraHosts>
Returns additional host mappings with short and long forms retained.
Sourcepub const fn user(&self) -> Option<&UserSpec>
pub const fn user(&self) -> Option<&UserSpec>
Returns the raw-preserving container user/group value.
Sourcepub const fn userns_mode(&self) -> Option<&UserNamespaceMode>
pub const fn userns_mode(&self) -> Option<&UserNamespaceMode>
Returns the raw-preserving user-namespace mode.
Sourcepub fn group_add(&self) -> &[Located<String>]
pub fn group_add(&self) -> &[Located<String>]
Returns supplementary groups in authored order without resolving names or IDs.
Sourcepub const fn cap_add(&self) -> Option<&CapabilityAdd>
pub const fn cap_add(&self) -> Option<&CapabilityAdd>
Returns the explicitly authored capability-add sequence, including an explicit empty one.
Sourcepub const fn cap_drop(&self) -> Option<&CapabilityDrop>
pub const fn cap_drop(&self) -> Option<&CapabilityDrop>
Returns the explicitly authored capability-drop sequence, including an explicit empty one.
Sourcepub const fn devices(&self) -> Option<&Devices>
pub const fn devices(&self) -> Option<&Devices>
Returns the explicitly authored ordered device sequence, including an explicit empty one.
Sourcepub const fn dns(&self) -> Option<&Dns>
pub const fn dns(&self) -> Option<&Dns>
Returns raw service DNS servers with scalar and ordered-list forms retained.
Sourcepub const fn dns_options(&self) -> Option<&DnsOptions>
pub const fn dns_options(&self) -> Option<&DnsOptions>
Returns the explicitly authored ordered DNS resolver-option sequence.
Sourcepub const fn dns_search(&self) -> Option<&DnsSearch>
pub const fn dns_search(&self) -> Option<&DnsSearch>
Returns raw DNS search domains with scalar and ordered-list forms retained.
Sourcepub const fn expose(&self) -> Option<&Expose>
pub const fn expose(&self) -> Option<&Expose>
Returns the explicitly authored ordered exposed-port sequence.
Sourcepub const fn security_options(&self) -> Option<&SecurityOptions>
pub const fn security_options(&self) -> Option<&SecurityOptions>
Returns the explicitly authored ordered raw service security options.
Sourcepub const fn working_dir(&self) -> Option<&Located<String>>
pub const fn working_dir(&self) -> Option<&Located<String>>
Returns the container working-directory override.
Sourcepub const fn read_only(&self) -> Option<&Located<BooleanValue>>
pub const fn read_only(&self) -> Option<&Located<BooleanValue>>
Returns the explicit read-only root-filesystem choice.
Sourcepub const fn pids_limit(&self) -> Option<&PidsLimit>
pub const fn pids_limit(&self) -> Option<&PidsLimit>
Returns the raw-preserving service PID limit.
Sourcepub const fn cpu_count(&self) -> Option<&Located<CpuCount>>
pub const fn cpu_count(&self) -> Option<&Located<CpuCount>>
Returns the authored CPU-count scalar without quota or runtime interpretation.
Sourcepub const fn cpu_percent(&self) -> Option<&Located<CpuPercent>>
pub const fn cpu_percent(&self) -> Option<&Located<CpuPercent>>
Returns the authored CPU-percentage scalar without CPU or runtime interpretation.
Sourcepub const fn cpu_period(&self) -> Option<&Located<CpuPeriod>>
pub const fn cpu_period(&self) -> Option<&Located<CpuPeriod>>
Returns the authored CPU-period scalar without CPU or runtime interpretation.
Sourcepub const fn cpu_quota(&self) -> Option<&Located<CpuQuota>>
pub const fn cpu_quota(&self) -> Option<&Located<CpuQuota>>
Returns the authored CPU-quota scalar without CPU or runtime interpretation.
Sourcepub const fn cpu_rt_period(&self) -> Option<&Located<CpuRtPeriod>>
pub const fn cpu_rt_period(&self) -> Option<&Located<CpuRtPeriod>>
Returns the authored real-time CPU-period scalar without CPU or runtime interpretation.
Sourcepub const fn shm_size(&self) -> Option<&ShmSize>
pub const fn shm_size(&self) -> Option<&ShmSize>
Returns the raw-preserving service shared-memory size.
Sourcepub const fn mem_limit(&self) -> Option<&MemLimit>
pub const fn mem_limit(&self) -> Option<&MemLimit>
Returns the raw-preserving service memory limit.
Sourcepub const fn tmpfs(&self) -> Option<&Tmpfs>
pub const fn tmpfs(&self) -> Option<&Tmpfs>
Returns service-level temporary filesystems with scalar and list forms retained.
Sourcepub const fn sysctls(&self) -> Option<&Sysctls>
pub const fn sysctls(&self) -> Option<&Sysctls>
Returns service sysctls with mapping/list form and scalar spelling retained.
Sourcepub const fn logging(&self) -> Option<&Logging>
pub const fn logging(&self) -> Option<&Logging>
Returns service logging configuration with an uninterpreted driver and ordered options.
Sourcepub const fn pull_policy(&self) -> Option<&PullPolicy>
pub const fn pull_policy(&self) -> Option<&PullPolicy>
Returns the raw-preserving service image pull policy.
Sourcepub const fn restart(&self) -> Option<&RestartPolicy>
pub const fn restart(&self) -> Option<&RestartPolicy>
Returns the service-level container restart policy.
Sourcepub const fn stop_signal(&self) -> Option<&Located<String>>
pub const fn stop_signal(&self) -> Option<&Located<String>>
Returns the explicitly authored signal used to stop the service.
Sourcepub const fn stop_grace_period(&self) -> Option<&Located<StopGracePeriod>>
pub const fn stop_grace_period(&self) -> Option<&Located<StopGracePeriod>>
Returns the raw-preserving service stop grace period.
Sourcepub const fn ulimits(&self) -> Option<&Ulimits>
pub const fn ulimits(&self) -> Option<&Ulimits>
Returns explicitly authored service resource limits.
Sourcepub const fn depends_on(&self) -> Option<&DependsOn>
pub const fn depends_on(&self) -> Option<&DependsOn>
Returns service dependencies with short and long forms retained.
Sourcepub const fn healthcheck(&self) -> Option<&Healthcheck>
pub const fn healthcheck(&self) -> Option<&Healthcheck>
Returns the service health-check definition.
Sourcepub const fn build(&self) -> Option<&Build>
pub const fn build(&self) -> Option<&Build>
Returns the build declaration with short and long forms retained.
Sourcepub const fn deploy(&self) -> Option<&DeployDefinition>
pub const fn deploy(&self) -> Option<&DeployDefinition>
Returns independently classified deploy subfields.
Sourcepub fn volumes(&self) -> &[VolumeMount]
pub fn volumes(&self) -> &[VolumeMount]
Returns service-volume mounts in authored order.
Sourcepub const fn networks(&self) -> Option<&ServiceNetworks>
pub const fn networks(&self) -> Option<&ServiceNetworks>
Returns service network attachments with short and long forms kept distinct.
Sourcepub fn configs(&self) -> &[ConfigGrant]
pub fn configs(&self) -> &[ConfigGrant]
Returns service config grants in authored order.
Sourcepub fn secrets(&self) -> &[SecretGrant]
pub fn secrets(&self) -> &[SecretGrant]
Returns service secret grants in authored order.
Sourcepub fn extension_fields(&self) -> &[FieldReference]
pub fn extension_fields(&self) -> &[FieldReference]
Returns retained service x- extension fields.
Sourcepub fn unknown_fields(&self) -> &[FieldReference]
pub fn unknown_fields(&self) -> &[FieldReference]
Returns service fields not yet represented by the typed subset.