Skip to main content

Environment

Struct Environment 

Source
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>

Source

pub fn new(model: &'a dyn Model) -> Self

An environment over model with no variables of its own and no seams.

Source

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.

Source

pub fn with_resolver(self, resolver: &'a dyn Resolver) -> Self

Supplies the seam resolve() calls.

Source

pub fn with_terminology(self, terminology: &'a dyn Terminology) -> Self

Supplies the seam memberOf(), subsumes() and subsumedBy() call.

Source

pub fn with_profiles(self, profiles: &'a dyn Profiles) -> Self

Supplies the seam conformsTo() calls.

Source

pub fn with_definitions(self, definitions: &'a dyn Definitions) -> Self

Supplies the seam elementDefinition() and slice() call.

Source

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.

Source

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.

Source

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.

Source

pub fn model(&self) -> &'a dyn Model

The type model.

Trait Implementations§

Source§

impl Debug for Environment<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T, S> SpanWrap<S> for T
where S: WrappingSpan<T>,

Source§

fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned

Invokes WrappingSpan::make_wrapped to wrap an AST node in a span.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more