pub struct Environment<'a> { /* private fields */ }Expand description
What an evaluation runs with: the type model, the environment variables and the seams the caller supplies.
Implementations§
Source§impl<'a> Environment<'a>
impl<'a> Environment<'a>
Sourcepub fn new(model: &'a dyn Model) -> Self
pub fn new(model: &'a dyn Model) -> Self
An environment over model with no variables of its own and no seams.
Sourcepub fn with_variable(
self,
name: impl Into<String>,
value: Collection<'a>,
) -> Self
pub fn with_variable( self, name: impl Into<String>, value: Collection<'a>, ) -> Self
Defines the environment variable %name (N1 §9), which takes
precedence over a variable of the same name N1 or FHIR R4 define.
Sourcepub fn with_resolver(self, resolver: &'a dyn Resolver) -> Self
pub fn with_resolver(self, resolver: &'a dyn Resolver) -> Self
Supplies the seam resolve() calls.
Sourcepub fn with_terminology(self, terminology: &'a dyn Terminology) -> Self
pub fn with_terminology(self, terminology: &'a dyn Terminology) -> Self
Supplies the seam memberOf(), subsumes() and subsumedBy() call.
Sourcepub fn with_profiles(self, profiles: &'a dyn Profiles) -> Self
pub fn with_profiles(self, profiles: &'a dyn Profiles) -> Self
Supplies the seam conformsTo() calls.
Sourcepub fn with_definitions(self, definitions: &'a dyn Definitions) -> Self
pub fn with_definitions(self, definitions: &'a dyn Definitions) -> Self
Supplies the seam elementDefinition() and slice() call.
Sourcepub const fn with_now(self, now: Timestamp) -> Self
pub const fn with_now(self, now: Timestamp) -> Self
Fixes the instant now(), today() and timeOfDay() answer; without
it they read the clock once per evaluation.
Sourcepub const fn with_strict_ordering(self) -> Self
pub const fn with_strict_ordering(self) -> Self
Refuses an order-dependent operation on a collection whose order is undefined.
N1 §3.1 leaves the order of children() and descendants(), and of
every collection derived from them, undefined, and lets an
implementation return an error when first(), last(), tail(),
skip(), take() or the indexer runs over such a collection. With
this mode on, that is EvalError::Unordered; without it, those
operations answer in the order the document holds.
Sourcepub const fn with_fhirpath_stu3_functions(self) -> Self
pub const fn with_fhirpath_stu3_functions(self) -> Self
Admits the functions of STU3_FUNCTIONS, which FHIRPath 3.0.0 adds
as Standard for Trial Use.
Without it the evaluator is FHIRPath N1 2.0.0, the release FHIR R4
cites (fhirpath.html §2.9), and a call to one of them is
EvalError::UnknownFunction. Those this crate does not implement yet
stay that error with the option on.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Environment<'a>
impl<'a> !Send for Environment<'a>
impl<'a> !Sync for Environment<'a>
impl<'a> !UnwindSafe for Environment<'a>
impl<'a> Freeze for Environment<'a>
impl<'a> Unpin for Environment<'a>
impl<'a> UnsafeUnpin for Environment<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.