Skip to content
Snippets Groups Projects
Verified Commit 3871b2a5 authored by Loris Moulin's avatar Loris Moulin
Browse files

feat: added Serialization to Resources

parent 235a256f
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ use std::error::Error;
use lazy_static::lazy_static;
use regex::Regex;
use serde::Serialize;
use super::{
errors::{ConversionError, FieldError},
......@@ -27,7 +28,7 @@ use super::{
/// assert_eq!(quantity3.as_str(), "1Gi");
/// assert_eq!(quantity4.as_str(), "10000");
/// ```
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Serialize)]
pub struct ResourceQuantity(String);
impl ResourceQuantity {
......@@ -63,7 +64,7 @@ impl From<u64> for ResourceQuantity {
}
/// Resources limits used in the context of podman/k8s.
#[derive(Debug, Default, Clone, PartialEq)]
#[derive(Debug, Default, Clone, PartialEq, Serialize)]
pub struct Resources {
request_memory: Option<ResourceQuantity>,
request_cpu: Option<ResourceQuantity>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment