pub struct Parameter {
pub name: String,
pub value: Vec<String>,
pub modifier: Option<String>,
pub chains: Vec<ChainLink>,
}Expand description
A search parameter as written in the URL.
name and modifier are the first segment and chains the rest, each
with its own modifier: subject:Patient.name:exact is subject with
modifier Patient, then name with modifier exact.
Fields§
§name: String§value: Vec<String>The values as written after =, one per unescaped comma, with their
escapes (\, \| \$ \\) still in place. Read them through
Parameter::values or Parameter::segmented, which resolve the
escapes once the parameter’s type says what a | or $ means; build
one from literal text with escape.
modifier: Option<String>§chains: Vec<ChainLink>Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn is_chained(&self) -> bool
pub fn is_chained(&self) -> bool
Whether this parameter follows a reference (subject.name).
Sourcepub fn key(&self) -> String
pub fn key(&self) -> String
The parameter’s name as written in a URL: subject:Patient.name:exact.
Sourcepub fn value_string(&self) -> String
pub fn value_string(&self) -> String
The values as written after = in a URL: the pieces joined by commas,
their escapes intact, so a parsed query serialises to what was read.
Sourcepub fn values(&self) -> Cow<'_, [String]>
pub fn values(&self) -> Cow<'_, [String]>
Every value with its escapes resolved. Borrowed from the parameter when none has an escape, the common case.
Sourcepub fn each_value(&self) -> impl Iterator<Item = Cow<'_, str>>
pub fn each_value(&self) -> impl Iterator<Item = Cow<'_, str>>
Each value with its escapes resolved, borrowed when it has none. For a parser that keeps a slice of the value.
Trait Implementations§
Source§impl MetaValue for Parameter
impl MetaValue for Parameter
fn fields(&self) -> Vec<&'static str>
fn get_field<'a>(&'a self, field: &str) -> Option<&'a dyn MetaValue>
fn get_field_mut<'a>(&'a mut self, field: &str) -> Option<&'a mut dyn MetaValue>
fn get_index_mut<'a>( &'a mut self, _index: usize, ) -> Option<&'a mut dyn MetaValue>
fn get_index<'a>(&'a self, _index: usize) -> Option<&'a dyn MetaValue>
fn fhir_type(&self) -> &'static str
fn as_any(&self) -> &dyn Any
fn flatten(&self) -> Vec<&dyn MetaValue>
fn is_many(&self) -> bool
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin for Parameter
impl UnwindSafe for Parameter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more