pub struct Engine<'a, X> { /* private fields */ }Expand description
Runs StructureMaps.
Implementations§
Source§impl<'a, X: Expressions> Engine<'a, X>
impl<'a, X: Expressions> Engine<'a, X>
pub fn new(definitions: &'a dyn Definitions, expressions: X) -> Self
Sourcepub fn with_trace(self, trace: bool) -> Self
pub fn with_trace(self, trace: bool) -> Self
Records a debug trace of each transform: see Trace.
Sourcepub fn with_concept_maps(self, concept_maps: &'a dyn ConceptMapResolver) -> Self
pub fn with_concept_maps(self, concept_maps: &'a dyn ConceptMapResolver) -> Self
Where translate finds ConceptMaps that are not contained in the map.
Sourcepub fn with_translator(self, translator: &'a dyn TranslateService) -> Self
pub fn with_translator(self, translator: &'a dyn TranslateService) -> Self
A terminology service for translate with ConceptMaps neither the map nor the resolver
holds.
Sourcepub fn with_limits(self, limits: Limits) -> Self
pub fn with_limits(self, limits: Limits) -> Self
How much a transform may do; see Limits.
Sourcepub fn with_cancellation(self, cancel: &'a AtomicBool) -> Self
pub fn with_cancellation(self, cancel: &'a AtomicBool) -> Self
A flag the caller sets to stop running transforms; they fail with
ErrorKind::Cancelled at the next rule.
Sourcepub fn with_ids(self, ids: &'a dyn IdGenerator) -> Self
pub fn with_ids(self, ids: &'a dyn IdGenerator) -> Self
Where uuid() and new resource ids come from; random by default.
Sourcepub fn with_maps(self, maps: &'a dyn MapResolver) -> Self
pub fn with_maps(self, maps: &'a dyn MapResolver) -> Self
Where the maps named in imports come from.
Sourcepub async fn transform(
&self,
map: &StructureMap,
source: &Value,
) -> Result<Transformed, Error>
pub async fn transform( &self, map: &StructureMap, source: &Value, ) -> Result<Transformed, Error>
Transforms source with the map’s first group; the target is created from the type of
that group’s target parameter.
Sourcepub async fn transform_into(
&self,
map: &StructureMap,
source: &Value,
target: &Value,
) -> Result<Transformed, Error>
pub async fn transform_into( &self, map: &StructureMap, source: &Value, target: &Value, ) -> Result<Transformed, Error>
Transforms source into an existing target.
Auto Trait Implementations§
impl<'a, X> !Freeze for Engine<'a, X>
impl<'a, X> !RefUnwindSafe for Engine<'a, X>
impl<'a, X> !Send for Engine<'a, X>
impl<'a, X> !Sync for Engine<'a, X>
impl<'a, X> !UnwindSafe for Engine<'a, X>
impl<'a, X> Unpin for Engine<'a, X>where
X: Unpin,
impl<'a, X> UnsafeUnpin for Engine<'a, X>where
X: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more