Skip to main content

Schemas

Struct Schemas 

Source
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

Source

pub fn type_named(&self, name: &str) -> Option<&'static TypeSchema>

The schema of the type named name.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub fn is_resource(&self, name: &str) -> bool

Whether name is a resource type of this version.

Trait Implementations§

Source§

impl Clone for Schemas

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Schemas

Source§

impl Debug for Schemas

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Schemas

Source§

impl PartialEq for Schemas

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Schemas

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.