Skip to main content

Engine

Struct Engine 

Source
pub struct Engine<'a, X> { /* private fields */ }
Expand description

Runs StructureMaps.

Implementations§

Source§

impl<'a, X: Expressions> Engine<'a, X>

Source

pub fn new(definitions: &'a dyn Definitions, expressions: X) -> Self

Source

pub fn with_trace(self, trace: bool) -> Self

Records a debug trace of each transform: see Trace.

Source

pub fn with_concept_maps(self, concept_maps: &'a dyn ConceptMapResolver) -> Self

Where translate finds ConceptMaps that are not contained in the map.

Source

pub fn with_translator(self, translator: &'a dyn TranslateService) -> Self

A terminology service for translate with ConceptMaps neither the map nor the resolver holds.

Source

pub fn with_limits(self, limits: Limits) -> Self

How much a transform may do; see Limits.

Source

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.

Source

pub fn with_ids(self, ids: &'a dyn IdGenerator) -> Self

Where uuid() and new resource ids come from; random by default.

Source

pub fn with_maps(self, maps: &'a dyn MapResolver) -> Self

Where the maps named in imports come from.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.