AnyResource

Trait AnyResource 

Source
pub trait AnyResource<V: FhirVersion>: Send + Sync {
    const TYPE: V::ResourceType;
    const TYPE_STR: &'static str;

    // Required methods
    fn id(&self) -> Option<&str>;
    fn set_id(&mut self, id: String);
    fn version_id(&self) -> Option<&str>;
    fn set_version_id(&mut self, version_id: String);
}
Expand description

Basic trait to combine all resources from all FHIR versions to one. Especially for use in the client to accept and handly any resource. Only implemented if “builders” feature is active.

Required Associated Constants§

Source

const TYPE: V::ResourceType

ResourceType of this resource.

Source

const TYPE_STR: &'static str

Resource type of the resource as &str. Must be valid for use in URLs.

Required Methods§

Source

fn id(&self) -> Option<&str>

Get the resource’s ID as string.

Source

fn set_id(&mut self, id: String)

Set the resource’s ID.

Source

fn version_id(&self) -> Option<&str>

Get the resource’s version ID as string.

Source

fn set_version_id(&mut self, version_id: String)

Set the resource’s version ID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R> AnyResource<FhirR5> for R

Source§

const TYPE: ResourceType = R::TYPE

Source§

const TYPE_STR: &'static str