pub struct ComponentTemplateDef {
pub params: HashMap<String, ComponentTemplateParam>,
pub template: Value,
}Expand description
One entry of Scenario::components — a named, reusable template.
Schema-only twin of rustmotion_core::expand::ComponentDefinition
(private to that module — this type exists so components has a real,
documented shape in the exported schema; see Scenario::components’s
doc for why it can’t just reuse that private struct, and why this one is
never populated in practice).
Fields§
§params: HashMap<String, ComponentTemplateParam>Parameters this template accepts. Same shape as
ComponentTemplateParam — not VariableDefinition (the
scenario-level config entry shape): a template parameter’s
default is itself optional, and omitting it is what makes the
parameter required at every use site. config’s default has no
such omission story — it is always required there.
template: ValueThe subtree to instantiate: a single component object, or an array
of sibling component objects (a fragment spliced in place). May
itself contain nested for-each/use directives.
Trait Implementations§
Source§impl Clone for ComponentTemplateDef
impl Clone for ComponentTemplateDef
Source§impl Debug for ComponentTemplateDef
impl Debug for ComponentTemplateDef
Source§impl<'de> Deserialize<'de> for ComponentTemplateDef
impl<'de> Deserialize<'de> for ComponentTemplateDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ComponentTemplateDef
impl JsonSchema for ComponentTemplateDef
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ComponentTemplateDef
impl RefUnwindSafe for ComponentTemplateDef
impl Send for ComponentTemplateDef
impl Sync for ComponentTemplateDef
impl Unpin for ComponentTemplateDef
impl UnsafeUnpin for ComponentTemplateDef
impl UnwindSafe for ComponentTemplateDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more