pub trait PartialTemplate: Template {
// Required methods
fn template_instance_from_difference(
&self,
other: &Self,
) -> Option<TemplateInstance>;
fn update_from_instance(
&mut self,
instance: TemplateInstance,
) -> Result<(), TemplateError>;
}Expand description
Trait used to represent a Template implementation that supports generating partial template instances and is updatable from partial template instances
It is strongly recommended to use the srad_macros::Template derive macro instead of implementing this trait manually
Required Methods§
Sourcefn template_instance_from_difference(
&self,
other: &Self,
) -> Option<TemplateInstance>
fn template_instance_from_difference( &self, other: &Self, ) -> Option<TemplateInstance>
Create a template instance based on the difference between a template and another copy
Sourcefn update_from_instance(
&mut self,
instance: TemplateInstance,
) -> Result<(), TemplateError>
fn update_from_instance( &mut self, instance: TemplateInstance, ) -> Result<(), TemplateError>
Update the template from a TemplateInstance
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.