pub struct MemoryConfig {
pub limit: String,
pub swap: Option<String>,
pub reservation: Option<String>,
}Expand description
Memory configuration.
Fields§
§limit: StringMemory limit (e.g., “512m”, “2g”).
swap: Option<String>Swap limit (e.g., “1g”, “0” to disable).
reservation: Option<String>Memory reservation (soft limit).
Implementations§
Source§impl MemoryConfig
impl MemoryConfig
Sourcepub fn without_swap(self) -> Self
pub fn without_swap(self) -> Self
Disable swap.
Sourcepub fn with_reservation(self, reservation: impl Into<String>) -> Self
pub fn with_reservation(self, reservation: impl Into<String>) -> Self
Set memory reservation.
Sourcepub fn limit_as_bytes(&self) -> Option<u64>
pub fn limit_as_bytes(&self) -> Option<u64>
Parse the limit as bytes.
Sourcepub fn swap_as_bytes(&self) -> Option<u64>
pub fn swap_as_bytes(&self) -> Option<u64>
Parse the swap limit as bytes.
Sourcepub fn reservation_as_bytes(&self) -> Option<u64>
pub fn reservation_as_bytes(&self) -> Option<u64>
Parse the reservation as bytes.
Trait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§fn clone(&self) -> MemoryConfig
fn clone(&self) -> MemoryConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 MemoryConfig
impl Debug for MemoryConfig
Source§impl<'de> Deserialize<'de> for MemoryConfig
impl<'de> Deserialize<'de> for MemoryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MemoryConfig
impl RefUnwindSafe for MemoryConfig
impl Send for MemoryConfig
impl Sync for MemoryConfig
impl Unpin for MemoryConfig
impl UnwindSafe for MemoryConfig
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