pub struct PackageSet { /* private fields */ }Expand description
A set of packages with a complete dependency closure.
Implementations§
Source§impl PackageSet
impl PackageSet
Sourcepub fn load<P: AsRef<Path>>(
paths: impl IntoIterator<Item = P>,
) -> Result<Self, LoadError>
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.
Sourcepub fn new(packages: Vec<Package>) -> Result<Self, LoadError>
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.
Sourcepub fn packages(&self) -> &[Package]
pub fn packages(&self) -> &[Package]
Returns the packages of the set, sorted by name and version.
Sourcepub fn structure_definition(
&self,
canonical: &str,
) -> Result<Arc<StructureDefinition>, ResolveError>
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.
Sourcepub fn value_set(&self, canonical: &str) -> Result<Arc<ValueSet>, ResolveError>
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.
Sourcepub fn code_system(
&self,
canonical: &str,
) -> Result<Arc<CodeSystem>, ResolveError>
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§
Auto Trait Implementations§
impl Freeze for PackageSet
impl RefUnwindSafe for PackageSet
impl Send for PackageSet
impl Sync for PackageSet
impl Unpin for PackageSet
impl UnsafeUnpin for PackageSet
impl UnwindSafe for PackageSet
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> 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> ⓘ
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
WrappingSpan::make_wrapped to wrap an AST node in a span.