pub struct ResourcesSpec {
pub cpu: Option<f64>,
pub memory: Option<String>,
pub gpu: Option<GpuSpec>,
pub pids_limit: Option<i64>,
pub cpuset: Option<String>,
pub cpu_shares: Option<u32>,
pub memory_swap: Option<String>,
pub memory_reservation: Option<String>,
pub memory_swappiness: Option<u8>,
pub oom_score_adj: Option<i32>,
pub oom_kill_disable: Option<bool>,
pub blkio_weight: Option<u16>,
}Expand description
Resource limits (upper bounds, not reservations)
Fields§
§cpu: Option<f64>CPU limit (cores, e.g., 0.5, 1, 2)
memory: Option<String>Memory limit (e.g., “512Mi”, “1Gi”, “2Gi”)
gpu: Option<GpuSpec>GPU resource request
pids_limit: Option<i64>Maximum number of processes the container may spawn
(Docker --pids-limit).
cpuset: Option<String>CPUs that the container is allowed to execute on (Docker --cpuset-cpus).
Relative CPU shares (Docker --cpu-shares). Default weight is 1024.
memory_swap: Option<String>Total memory limit including swap (Docker --memory-swap).
memory_reservation: Option<String>Soft memory limit (Docker --memory-reservation).
memory_swappiness: Option<u8>Container memory swappiness, 0-100 (Docker --memory-swappiness).
oom_score_adj: Option<i32>OOM-killer score adjustment (Docker --oom-score-adj).
oom_kill_disable: Option<bool>Disable the OOM killer for the container (Docker --oom-kill-disable).
blkio_weight: Option<u16>Block IO weight, 10-1000 (Docker --blkio-weight).
Trait Implementations§
Source§impl Clone for ResourcesSpec
impl Clone for ResourcesSpec
Source§fn clone(&self) -> ResourcesSpec
fn clone(&self) -> ResourcesSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourcesSpec
impl Debug for ResourcesSpec
Source§impl Default for ResourcesSpec
impl Default for ResourcesSpec
Source§fn default() -> ResourcesSpec
fn default() -> ResourcesSpec
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResourcesSpec
impl<'de> Deserialize<'de> for ResourcesSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourcesSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourcesSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResourcesSpec
impl PartialEq for ResourcesSpec
Source§fn eq(&self, other: &ResourcesSpec) -> bool
fn eq(&self, other: &ResourcesSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ResourcesSpec
impl Serialize for ResourcesSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Validate for ResourcesSpec
impl Validate for ResourcesSpec
Source§impl<'v_a> ValidateArgs<'v_a> for ResourcesSpec
impl<'v_a> ValidateArgs<'v_a> for ResourcesSpec
type Args = ()
fn validate_with_args( &self, args: <ResourcesSpec as ValidateArgs<'v_a>>::Args, ) -> Result<(), ValidationErrors>
impl StructuralPartialEq for ResourcesSpec
Auto Trait Implementations§
impl Freeze for ResourcesSpec
impl RefUnwindSafe for ResourcesSpec
impl Send for ResourcesSpec
impl Sync for ResourcesSpec
impl Unpin for ResourcesSpec
impl UnsafeUnpin for ResourcesSpec
impl UnwindSafe for ResourcesSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more