pub trait TemplateSink {
type Error;
// Required methods
fn begin(&mut self, template: &SetTemplate) -> Result<(), Self::Error>;
fn property(
&mut self,
path: &str,
property: &PropertyTemplate,
) -> Result<(), Self::Error>;
fn finish(&mut self, template: &SetTemplate) -> Result<(), Self::Error>;
// Provided method
fn quantity(
&mut self,
_quantity: &QuantityTemplate,
) -> Result<(), Self::Error> { ... }
}Expand description
Adapter boundary for creating authored data from a catalog template.
A sink owns transactionality: if a callback fails, it must roll back any partial authored state itself.
Required Associated Types§
Required Methods§
Sourcefn begin(&mut self, template: &SetTemplate) -> Result<(), Self::Error>
fn begin(&mut self, template: &SetTemplate) -> Result<(), Self::Error>
Called once before any member callback for template. Sinks that
open a transaction or authored-set shell should do it here.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".