Skip to main content

Service

Struct Service 

Source
#[non_exhaustive]
pub struct Service {
Show 28 fields pub service: String, pub state: ServiceState, pub container_running: bool, pub image: String, pub builds_image: bool, pub image_digest: String, pub image_size_bytes: u64, pub command: Vec<String>, pub run_as_user: String, pub start_time: Option<Timestamp>, pub finish_time: Option<Timestamp>, pub exit_code: Option<i32>, pub out_of_memory: bool, pub restart_count: u32, pub cpu_used_cores: f64, pub memory_used_bytes: u64, pub memory_limit_bytes: u64, pub cpu_limit_cores: f64, pub writable_layer_bytes: u64, pub ports: Vec<u32>, pub listening_ports: Vec<u32>, pub published_ports: Vec<PublishedPort>, pub volume_mounts: Vec<VolumeMount>, pub restart_policy: RestartPolicy, pub health_check: Option<HealthCheck>, pub environment: Vec<EnvironmentVariable>, pub env_files: Vec<String>, pub ssh_command: String,
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§service: String§state: ServiceState§container_running: bool

True = its container runs, as Client::run_service_command, OpenTerminal and Client::read_path of its own files (outside volumes) need: in RUNNING, HEALTHY and UNHEALTHY, and in STARTING once its process started.

§image: String

The image as compose.yaml names it; for build: without image:, the name Compose gives.

§builds_image: bool

Built on the machine from a build: section.

§image_digest: String

The registry digest it was pulled as, "sha256:...". Empty for a built image.

§image_size_bytes: u64

Absent until the machine next measures sizes, every few minutes, as after a build or pull.

§command: Vec<String>

What the main process runs, as compose.yaml writes it (entrypoint, then command), ${...} not interpolated, so that no value of an env file shows; the image’s own argv when compose.yaml writes neither. Empty = not known without those values: compose.yaml loads only interpolated, e.g. with an include path from .env.

§run_as_user: String§start_time: Option<Timestamp>

Of the current or last run.

§finish_time: Option<Timestamp>

Set once it exited, and while Docker waits to restart it: when, with what code (0 = a clean exit: a job that finished, or a server stopped; 137 = killed), and whether a process of it was killed for exceeding its memory.

§exit_code: Option<i32>§out_of_memory: bool§restart_count: u32

Restarts by Docker since the container was created.

§cpu_used_cores: f64§memory_used_bytes: u64§memory_limit_bytes: u64

0 = no limit: it shares the machine.

§cpu_limit_cores: f64

0 = no limit.

§writable_layer_bytes: u64

Written outside volumes: lost on a recreate.

§ports: Vec<u32>

The ports it is reached at, as far as the machine knows: those compose.yaml or its image declares and those its routes send to. The project’s other services reach it at <service>:<port>.

§listening_ports: Vec<u32>

The TCP ports its processes listen on now, at an address the proxy and the other services reach: a route’s port must be one of them. Empty = it does not run, or listens on none.

§published_ports: Vec<PublishedPort>

The ports ports: opens on the machine now: not one a route serves, nor one bound to 127.0.0.1.

§volume_mounts: Vec<VolumeMount>§restart_policy: RestartPolicy§health_check: Option<HealthCheck>

Absent = no healthcheck.

§environment: Vec<EnvironmentVariable>

What the container is configured with, not what its image sets.

§env_files: Vec<String>

The files its env_file: names, as compose.yaml writes them, e.g. "./.env": relative to the project directory. Change them with DeployProjectRequest::files.

§ssh_command: String

What the person runs in their own terminal for a shell in its container, e.g. "ssh web.notes@m1.pethost.dev"; scp, sftp, rsync and ssh -L tunnels take the same address. It works once one of their public keys is among Machine::ssh_keys.

Trait Implementations§

Source§

impl Clone for Service

Source§

fn clone(&self) -> Self

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 Default for Service

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Service

From the API’s JSON. A field this version does not know is refused, as the API refuses one it does not have.

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Service

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for Service

As the API’s JSON: the proto’s field names, an enum as its value’s name, a 64-bit integer as a string, a time as RFC 3339, bytes as base64.

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> JsonDeserialize for T

Source§

impl<T> JsonSerialize for T

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more