pub struct Expression { /* private fields */ }Expand description
A FHIRPath expression, parsed.
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn parse(text: &str) -> Result<Self, ParseError>
pub fn parse(text: &str) -> Result<Self, ParseError>
Sourcepub fn check(
&self,
model: &dyn Model,
context: FhirType,
) -> Result<(), SemanticError>
pub fn check( &self, model: &dyn Model, context: FhirType, ) -> Result<(), SemanticError>
Checks the expression against the type its context will have: every member a path names must be one the types along the path define, and a path that starts with a type name must start with the context’s (N1 §3, §11).
§Errors
Returns SemanticError for the first member or type name the model
refuses.
Sourcepub fn check_any(
&self,
model: &dyn Model,
contexts: &[FhirType],
) -> Result<(), SemanticError>
pub fn check_any( &self, model: &dyn Model, contexts: &[FhirType], ) -> Result<(), SemanticError>
Checks the expression against a context that may hold any of the
types contexts, as an occurrence of a choice element does (R4
§2.9.1.1, crate::model::path_types): a member is accepted when one
of them defines it, and refused when none does.
§Errors
Returns SemanticError for the first member or type name the model
refuses.
Sourcepub fn evaluate<'a>(
&self,
env: &Environment<'a>,
focus: Focus<'a>,
) -> Result<Collection<'a>, EvalError>
pub fn evaluate<'a>( &self, env: &Environment<'a>, focus: Focus<'a>, ) -> Result<Collection<'a>, EvalError>
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§impl Debug for Expression
impl Debug for Expression
Source§impl Display for Expression
impl Display for Expression
impl Eq for Expression
Source§impl FromStr for Expression
impl FromStr for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
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
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.