#[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 Context {
#[builder(
default,
map(key(type = super::VariableName), value(type = super::VariableValue))
)]
#[serde(
rename = "variables",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
variables: std::collections::BTreeMap<super::VariableName, super::VariableValue>,
#[builder(default, into)]
#[serde(
rename = "functionVariables",
skip_serializing_if = "Option::is_none",
default
)]
function_variables: Option<
std::collections::BTreeMap<super::FunctionReference, super::FunctionVariables>,
>,
#[builder(
default,
map(key(type = super::FrameReferenceName), value(type = super::DataFrame))
)]
#[serde(
rename = "frameReferences",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
frame_references: std::collections::BTreeMap<
super::FrameReferenceName,
super::DataFrame,
>,
}
impl Context {
#[inline]
pub fn new() -> Self {
Self::builder().build()
}
#[inline]
pub fn variables(
&self,
) -> &std::collections::BTreeMap<super::VariableName, super::VariableValue> {
&self.variables
}
#[deprecated(
note = "This field is deprecated and will be removed in a future version.\n"
)]
#[inline]
pub fn function_variables(
&self,
) -> Option<
&std::collections::BTreeMap<super::FunctionReference, super::FunctionVariables>,
> {
self.function_variables.as_ref().map(|o| &*o)
}
#[inline]
pub fn frame_references(
&self,
) -> &std::collections::BTreeMap<super::FrameReferenceName, super::DataFrame> {
&self.frame_references
}
}