pub struct Schemas {
pub types: &'static [TypeSchema],
pub resources: &'static [&'static str],
pub primitives: &'static [PrimitiveSchema],
}Expand description
A version’s schema: every type, sorted by name, the resource names and the primitive types.
Fields§
§types: &'static [TypeSchema]The types, sorted by name.
resources: &'static [&'static str]The resource type names, sorted.
primitives: &'static [PrimitiveSchema]The primitive types, sorted by name.
Implementations§
Source§impl Schemas
impl Schemas
Sourcepub fn type_named(&self, name: &str) -> Option<&'static TypeSchema>
pub fn type_named(&self, name: &str) -> Option<&'static TypeSchema>
The schema of the type named name.
Sourcepub fn base_of(&self, name: &str) -> Option<&'static str>
pub fn base_of(&self, name: &str) -> Option<&'static str>
The name of the type name specializes, None for a type at the root
of the hierarchy and for a name the table does not carry.
Sourcepub fn primitive_base_of(&self, name: &str) -> Option<&'static str>
pub fn primitive_base_of(&self, name: &str) -> Option<&'static str>
The type the primitive name specializes, None for a code that names
no primitive and for a primitive whose definition names no base.
Sourcepub fn specializes(&self, name: &str, ancestor: &str) -> bool
pub fn specializes(&self, name: &str, ancestor: &str) -> bool
Whether the type name is ancestor or specializes it, directly or
through its base chain: Age specializes Quantity, and Patient
specializes DomainResource and Resource
(https://hl7.org/fhir/R5/types.html).
Sourcepub fn element(
&self,
path: &str,
) -> Option<(&'static TypeSchema, &'static FieldSchema)>
pub fn element( &self, path: &str, ) -> Option<(&'static TypeSchema, &'static FieldSchema)>
The type and element a dotted element path names.
The walk starts at the resource or datatype the first segment names and
follows each further segment through the complex and backbone types the
elements hold, including the hop a contentReference makes
(https://hl7.org/fhir/R4/elementdefinition.html). A choice element
answers to its base path (Observation.value[x]) and to every expanded
form the JSON representation gives it (Observation.valueQuantity,
https://hl7.org/fhir/R4/json.html). A path that continues through a
primitive, through a resource-typed element, or through the base form of
a choice has no element here, and neither has a path the schema does not
know.
Sourcepub fn type_of(&self, path: &str) -> Option<&'static TypeSchema>
pub fn type_of(&self, path: &str) -> Option<&'static TypeSchema>
The type an element path resolves to.
A bare type name resolves to that type; an element path resolves to the complex or backbone type the element holds. A primitive element has no type here, because the schema carries only complex types.
Sourcepub fn is_resource(&self, name: &str) -> bool
pub fn is_resource(&self, name: &str) -> bool
Whether name is a resource type of this version.