pub enum CpuAmount {
Integer(i64),
Float(f64),
Quantity(String),
}Expand description
A CPU amount written as a number of cores (2, 0.5) or a quantity string ("500m").
Variants§
Integer(i64)
Whole cores.
Float(f64)
Fractional cores.
Quantity(String)
A Kubernetes-style quantity, passed through verbatim.
Implementations§
Source§impl CpuAmount
impl CpuAmount
Sourcepub fn to_quantity(&self, field: &str) -> Result<String>
pub fn to_quantity(&self, field: &str) -> Result<String>
The canonical string form: numbers print like JavaScript does (2, 0.5).
Sourcepub fn to_resource_spec(&self, field: &str) -> Result<ResourceSpec>
pub fn to_resource_spec(&self, field: &str) -> Result<ResourceSpec>
A workload request that asks for exactly this much CPU.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CpuAmount
impl<'de> Deserialize<'de> for CpuAmount
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
impl StructuralPartialEq for CpuAmount
Auto Trait Implementations§
impl Forget for CpuAmount
impl Freeze for CpuAmount
impl Move for CpuAmount
impl RefUnwindSafe for CpuAmount
impl Send for CpuAmount
impl Sync for CpuAmount
impl Unpin for CpuAmount
impl UnsafeUnpin for CpuAmount
impl UnwindSafe for CpuAmount
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