nominal-api 0.1259.1

API bindings for the Nominal platform
Documentation
#![allow(deprecated)]
use std::fmt;
use std::str;
/// One of the baked matcaps in the volumesight atlas.
#[derive(
    Debug,
    Clone,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    conjure_object::serde::Deserialize,
    conjure_object::serde::Serialize,
)]
#[serde(crate = "conjure_object::serde")]
pub enum SpatialMatcap {
    #[serde(rename = "SOAP")]
    Soap,
    #[serde(rename = "SILVER")]
    Silver,
    #[serde(rename = "GOLD")]
    Gold,
    #[serde(rename = "PLASTIC")]
    Plastic,
    #[serde(rename = "TILE")]
    Tile,
    #[serde(rename = "VIOLET_CHROME")]
    VioletChrome,
    #[serde(rename = "TRAFFIC_CONE")]
    TrafficCone,
    #[serde(rename = "EMERALD")]
    Emerald,
    #[serde(rename = "AMETHYST")]
    Amethyst,
    #[serde(rename = "BLUE_PAINT")]
    BluePaint,
    #[serde(rename = "RED_CAR")]
    RedCar,
    #[serde(rename = "BEETLE")]
    Beetle,
    #[serde(rename = "BUBBLE")]
    Bubble,
    #[serde(rename = "PEARL")]
    Pearl,
    #[serde(rename = "WAX")]
    Wax,
    #[serde(rename = "MARBLE")]
    Marble,
    /// An unknown variant.
    #[serde(untagged)]
    Unknown(Unknown),
}
impl SpatialMatcap {
    /// Returns the string representation of the enum.
    #[inline]
    pub fn as_str(&self) -> &str {
        match self {
            SpatialMatcap::Soap => "SOAP",
            SpatialMatcap::Silver => "SILVER",
            SpatialMatcap::Gold => "GOLD",
            SpatialMatcap::Plastic => "PLASTIC",
            SpatialMatcap::Tile => "TILE",
            SpatialMatcap::VioletChrome => "VIOLET_CHROME",
            SpatialMatcap::TrafficCone => "TRAFFIC_CONE",
            SpatialMatcap::Emerald => "EMERALD",
            SpatialMatcap::Amethyst => "AMETHYST",
            SpatialMatcap::BluePaint => "BLUE_PAINT",
            SpatialMatcap::RedCar => "RED_CAR",
            SpatialMatcap::Beetle => "BEETLE",
            SpatialMatcap::Bubble => "BUBBLE",
            SpatialMatcap::Pearl => "PEARL",
            SpatialMatcap::Wax => "WAX",
            SpatialMatcap::Marble => "MARBLE",
            SpatialMatcap::Unknown(v) => &*v,
        }
    }
}
impl fmt::Display for SpatialMatcap {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt::Display::fmt(self.as_str(), fmt)
    }
}
impl conjure_object::Plain for SpatialMatcap {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        conjure_object::Plain::fmt(self.as_str(), fmt)
    }
}
impl str::FromStr for SpatialMatcap {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_str(
        v: &str,
    ) -> Result<SpatialMatcap, conjure_object::plain::ParseEnumError> {
        match v {
            "SOAP" => Ok(SpatialMatcap::Soap),
            "SILVER" => Ok(SpatialMatcap::Silver),
            "GOLD" => Ok(SpatialMatcap::Gold),
            "PLASTIC" => Ok(SpatialMatcap::Plastic),
            "TILE" => Ok(SpatialMatcap::Tile),
            "VIOLET_CHROME" => Ok(SpatialMatcap::VioletChrome),
            "TRAFFIC_CONE" => Ok(SpatialMatcap::TrafficCone),
            "EMERALD" => Ok(SpatialMatcap::Emerald),
            "AMETHYST" => Ok(SpatialMatcap::Amethyst),
            "BLUE_PAINT" => Ok(SpatialMatcap::BluePaint),
            "RED_CAR" => Ok(SpatialMatcap::RedCar),
            "BEETLE" => Ok(SpatialMatcap::Beetle),
            "BUBBLE" => Ok(SpatialMatcap::Bubble),
            "PEARL" => Ok(SpatialMatcap::Pearl),
            "WAX" => Ok(SpatialMatcap::Wax),
            "MARBLE" => Ok(SpatialMatcap::Marble),
            v => v.parse().map(|v| SpatialMatcap::Unknown(Unknown(v))),
        }
    }
}
impl conjure_object::FromPlain for SpatialMatcap {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_plain(
        v: &str,
    ) -> Result<SpatialMatcap, conjure_object::plain::ParseEnumError> {
        v.parse()
    }
}
///An unknown variant of the SpatialMatcap enum.
#[derive(
    Debug,
    Clone,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    conjure_object::serde::Deserialize,
    conjure_object::serde::Serialize,
)]
#[serde(crate = "conjure_object::serde", transparent)]
pub struct Unknown(conjure_object::private::Variant);
impl std::ops::Deref for Unknown {
    type Target = str;
    #[inline]
    fn deref(&self) -> &str {
        &self.0
    }
}
impl fmt::Display for Unknown {
    #[inline]
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
        fmt::Display::fmt(&self.0, fmt)
    }
}