Skip to main content

PackageSet

Struct PackageSet 

Source
pub struct PackageSet { /* private fields */ }
Expand description

A set of packages with a complete dependency closure.

Implementations§

Source§

impl PackageSet

Source

pub fn load<P: AsRef<Path>>( paths: impl IntoIterator<Item = P>, ) -> Result<Self, LoadError>

Reads every package at paths (.tgz files or unpacked directories) and builds the set.

§Errors

Returns LoadError when a package cannot be read, or as PackageSet::new does.

Source

pub fn new(packages: Vec<Package>) -> Result<Self, LoadError>

Builds the set from packages already read, checking the closure.

Every dependency a manifest names SHALL be listed, and a version whose patch is x accepts the highest patch present (https://hl7.org/fhir/packages.html, §2.1.10.2).

§Errors

Returns LoadError::DuplicatePackage for a name and version given twice, and LoadError::MissingDependency naming the first dependency the set does not hold.

Source

pub fn packages(&self) -> &[Package]

Returns the packages of the set, sorted by name and version.

Source

pub fn structure_definition( &self, canonical: &str, ) -> Result<Arc<StructureDefinition>, ResolveError>

Resolves canonical to the StructureDefinition it names.

url|version resolves to that version. A bare url resolves to its one version, or to the latest when the set carries several, as R4 asks (https://hl7.org/fhir/R4/references.html#canonical, §2.3.0.5); the order is compare_versions, and a definition without a version sorts below every versioned one.

§Errors

Returns ResolveError when nothing matches, the canonical names a contained resource, two different definitions share the URL and version, or the definition does not decode.

Source

pub fn value_set(&self, canonical: &str) -> Result<Arc<ValueSet>, ResolveError>

Resolves canonical to the ValueSet it names, by the rules of PackageSet::structure_definition.

§Errors

Returns ResolveError as PackageSet::structure_definition does.

Source

pub fn code_system( &self, canonical: &str, ) -> Result<Arc<CodeSystem>, ResolveError>

Resolves canonical to the CodeSystem it names, by the rules of PackageSet::structure_definition.

§Errors

Returns ResolveError as PackageSet::structure_definition does.

Trait Implementations§

Source§

impl Debug for PackageSet

Source§

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

Formats the value using the given formatter. Read more

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