pub trait AnyResourceWrite:
Serialize
+ Send
+ Sync {
type Version: FhirVersion;
// Required methods
fn update(
&mut self,
conditional: bool,
client: &Client<Self::Version>,
) -> impl Future<Output = Result<bool, Error>> + Send;
fn create(
&mut self,
client: &Client<Self::Version>,
) -> impl Future<Output = Result<String, Error>> + Send;
fn delete(
self,
client: &Client<Self::Version>,
) -> impl Future<Output = Result<(), Error>> + Send;
}
Expand description
A trait to write the resource enum to the FHIR server, mutating the interior
id and version_id so that the resource is up to date for future update
requests.
This trait sadly needs to be separate to ResourceWrite
,
because we cannot both implement the generic trait as well as implementing
it on a type that fhir-model could implement the required traits for.
Required Associated Types§
Sourcetype Version: FhirVersion
type Version: FhirVersion
FHIR client version type.
Required Methods§
Sourcefn update(
&mut self,
conditional: bool,
client: &Client<Self::Version>,
) -> impl Future<Output = Result<bool, Error>> + Send
fn update( &mut self, conditional: bool, client: &Client<Self::Version>, ) -> impl Future<Output = Result<bool, Error>> + Send
Update the current version of the resource on the server. Returns whether the resource was created.
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.