#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct Trace {
#[builder(into)]
#[serde(rename = "plotlyTrace")]
plotly_trace: String,
#[builder(
default,
custom(
type = impl
Into<Option<super::TraceCompute>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "compute", skip_serializing_if = "Option::is_none", default)]
compute: Option<Box<super::TraceCompute>>,
}
impl Trace {
#[inline]
pub fn new(plotly_trace: impl Into<String>) -> Self {
Self::builder().plotly_trace(plotly_trace).build()
}
#[inline]
pub fn plotly_trace(&self) -> &str {
&*self.plotly_trace
}
#[inline]
pub fn compute(&self) -> Option<&super::TraceCompute> {
self.compute.as_ref().map(|o| &**o)
}
}