pub struct UlimitSpec {
pub soft: i64,
pub hard: i64,
}Expand description
Per-process resource limit (Docker --ulimit style).
§Default-fill rules (mirrors Docker --ulimit)
Docker requires soft and lets hard default to soft. We are liberal in
what we accept so that an omitted bound never yields the footgun of
hard < soft (which makes setrlimit fail with EINVAL, or pins the hard
cap at 0):
- both present → used as-is.
hardabsent →hard = soft(Docker’s documented behavior).softabsent →soft = hard(a lone bound applies to both; never producessoft > hard).- both absent → both
0(preserves theDefaultshape).
The public fields stay soft: i64, hard: i64; the fill happens during
deserialization so consumers always see a fully-populated, consistent pair.
Fields§
§soft: i64Soft limit. If omitted in the input, defaults to hard (or 0 when
both are omitted).
hard: i64Hard limit. If omitted in the input, defaults to soft (Docker’s
--ulimit behavior), so an omitted hard cap never falls below the soft
limit.
Trait Implementations§
Source§impl Clone for UlimitSpec
impl Clone for UlimitSpec
Source§fn clone(&self) -> UlimitSpec
fn clone(&self) -> UlimitSpec
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 UlimitSpec
impl Debug for UlimitSpec
Source§impl Default for UlimitSpec
impl Default for UlimitSpec
Source§fn default() -> UlimitSpec
fn default() -> UlimitSpec
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UlimitSpec
impl<'de> Deserialize<'de> for UlimitSpec
Source§fn deserialize<D>(
deserializer: D,
) -> Result<UlimitSpec, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<UlimitSpec, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for UlimitSpec
Source§impl PartialEq for UlimitSpec
impl PartialEq for UlimitSpec
Source§fn eq(&self, other: &UlimitSpec) -> bool
fn eq(&self, other: &UlimitSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UlimitSpec
impl Serialize for UlimitSpec
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
impl StructuralPartialEq for UlimitSpec
Auto Trait Implementations§
impl Freeze for UlimitSpec
impl RefUnwindSafe for UlimitSpec
impl Send for UlimitSpec
impl Sync for UlimitSpec
impl Unpin for UlimitSpec
impl UnsafeUnpin for UlimitSpec
impl UnwindSafe for UlimitSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.