nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
/// Return type representing a single point value.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct SinglePoint {
    #[builder(
        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
    )]
    #[serde(rename = "timestamp")]
    timestamp: Box<super::super::super::super::api::Timestamp>,
    #[builder(custom(type = super::Value, convert = Box::new))]
    #[serde(rename = "value")]
    value: Box<super::Value>,
    #[serde(rename = "precisionLoss")]
    precision_loss: bool,
}
impl SinglePoint {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        timestamp: super::super::super::super::api::Timestamp,
        value: super::Value,
        precision_loss: bool,
    ) -> Self {
        Self::builder()
            .timestamp(timestamp)
            .value(value)
            .precision_loss(precision_loss)
            .build()
    }
    #[inline]
    pub fn timestamp(&self) -> &super::super::super::super::api::Timestamp {
        &*self.timestamp
    }
    #[inline]
    pub fn value(&self) -> &super::Value {
        &*self.value
    }
    /// Returns true if the result required downcasting to a type with less precision,
    /// for example if the input series was Int64 and the result is a Float64.
    #[inline]
    pub fn precision_loss(&self) -> bool {
        self.precision_loss
    }
}