Struct mz_orchestrator::ServiceConfig
source · [−]pub struct ServiceConfig<'a> {
pub image: String,
pub args: &'a (dyn Fn(&ServiceAssignments<'_>) -> Vec<String> + Send + Sync),
pub ports: Vec<ServicePort>,
pub memory_limit: Option<MemoryLimit>,
pub cpu_limit: Option<CpuLimit>,
pub scale: NonZeroUsize,
pub labels: HashMap<String, String>,
pub availability_zone: Option<String>,
}
Expand description
Describes the desired state of a service.
Fields
image: String
An opaque identifier for the executable or container image to run.
Often names a container on Docker Hub or a path on the local machine.
args: &'a (dyn Fn(&ServiceAssignments<'_>) -> Vec<String> + Send + Sync)
A function that generates the arguments for each process of the service given the assignments that the orchestrator has made.
ports: Vec<ServicePort>
Ports to expose.
memory_limit: Option<MemoryLimit>
An optional limit on the memory that the service can use.
cpu_limit: Option<CpuLimit>
An optional limit on the CPU that the service can use.
scale: NonZeroUsize
The number of copies of this service to run.
labels: HashMap<String, String>
Arbitrary key–value pairs to attach to the service in the orchestrator backend.
The orchestrator backend may apply a prefix to the key if appropriate.
availability_zone: Option<String>
The availability zone the service should be run in. If no availability zone is specified, the orchestrator is free to choose one.
Trait Implementations
sourceimpl<'a> Clone for ServiceConfig<'a>
impl<'a> Clone for ServiceConfig<'a>
sourcefn clone(&self) -> ServiceConfig<'a>
fn clone(&self) -> ServiceConfig<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ServiceConfig<'a>
impl<'a> Send for ServiceConfig<'a>
impl<'a> Sync for ServiceConfig<'a>
impl<'a> Unpin for ServiceConfig<'a>
impl<'a> !UnwindSafe for ServiceConfig<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more