#
k8s_openapi/v1_35/api/scheduling/v1alpha1/
basic_scheduling_policy.rs

    1// Generated from definition io.k8s.api.scheduling.v1alpha1.BasicSchedulingPolicy
    2
    3/// BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.
    4#[derive(Clone, Debug, Default, PartialEq)]
    5pub struct BasicSchedulingPolicy(pub crate::serde_json::Value);
    6
    7impl crate::DeepMerge for BasicSchedulingPolicy {
    8    fn merge_from(&mut self, other: Self) {
    9        crate::DeepMerge::merge_from(&mut self.0, other.0);
    10    }
    11}
    12
    13impl<'de> crate::serde::Deserialize<'de> for BasicSchedulingPolicy {
    14    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: crate::serde::Deserializer<'de> {
    15        struct Visitor;
    16
    17        impl<'de> crate::serde::de::Visitor<'de> for Visitor {
    18            type Value = BasicSchedulingPolicy;
    19
    20            fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    21                f.write_str("BasicSchedulingPolicy")
    22            }
    23
    24            fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error> where D: crate::serde::Deserializer<'de> {
    25                Ok(BasicSchedulingPolicy(crate::serde::Deserialize::deserialize(deserializer)?))
    26            }
    27        }
    28
    29        deserializer.deserialize_newtype_struct("BasicSchedulingPolicy", Visitor)
    30    }
    31}
    32
    33impl From<crate::serde_json::Value> for BasicSchedulingPolicy {
    34    fn from(inner: crate::serde_json::Value) -> Self {
    35        Self(inner)
    36    }
    37}
    38
    39impl crate::serde::Serialize for BasicSchedulingPolicy {
    40    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: crate::serde::Serializer {
    41        serializer.serialize_newtype_struct("BasicSchedulingPolicy", &self.0)
    42    }
    43}
    44
    45#[cfg(feature = "schemars")]
    46impl crate::schemars::JsonSchema for BasicSchedulingPolicy {
    47    fn schema_name() -> std::borrow::Cow<'static, str> {
    48        "io.k8s.api.scheduling.v1alpha1.BasicSchedulingPolicy".into()
    49    }
    50
    51    fn json_schema(__gen: &mut crate::schemars::SchemaGenerator) -> crate::schemars::Schema {
    52        crate::schemars::json_schema!({
    53            "description": "BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.",
    54            "type": "object",
    55        })
    56    }
    57}