pub trait FHIRRepository: Sized {
// Required methods
fn create(
&self,
tenant: &TenantId,
project: &ProjectId,
user: &UserTokenClaims,
fhir_version: &SupportedFHIRVersions,
resource: Resource,
) -> impl Future<Output = Result<Resource, OperationOutcomeError>> + Send;
fn update(
&self,
tenant: &TenantId,
project: &ProjectId,
user: &UserTokenClaims,
fhir_version: &SupportedFHIRVersions,
resource: Resource,
id: &str,
) -> impl Future<Output = Result<Resource, OperationOutcomeError>> + Send;
fn delete(
&self,
tenant: &TenantId,
project: &ProjectId,
user: &UserTokenClaims,
fhir_version: &SupportedFHIRVersions,
resource: Resource,
id: &str,
) -> impl Future<Output = Result<Resource, OperationOutcomeError>> + Send;
fn read_by_version_ids(
&self,
tenant_id: &TenantId,
project_id: &ProjectId,
version_id: &[&VersionId],
cache_policy: CachePolicy,
) -> impl Future<Output = Result<Vec<Resource>, OperationOutcomeError>> + Send;
fn read_latest(
&self,
tenant_id: &TenantId,
project_id: &ProjectId,
resource_type: &ResourceType,
resource_id: &ResourceId,
) -> impl Future<Output = Result<Option<Resource>, OperationOutcomeError>> + Send;
fn read_latest_many(
&self,
tenant_id: &TenantId,
project_id: &ProjectId,
keys: &[(ResourceType, ResourceId)],
) -> impl Future<Output = Result<Vec<Resource>, OperationOutcomeError>> + Send;
fn history(
&self,
tenant_id: &TenantId,
project_id: &ProjectId,
request: &HistoryRequest,
) -> impl Future<Output = Result<Vec<ResourceHistoryValue>, OperationOutcomeError>> + Send;
fn transaction(
&self,
register: bool,
) -> impl Future<Output = Result<Self, OperationOutcomeError>> + Send;
fn in_transaction(&self) -> bool;
fn commit(
self,
) -> impl Future<Output = Result<(), OperationOutcomeError>> + Send;
fn rollback(
self,
) -> impl Future<Output = Result<(), OperationOutcomeError>> + Send;
}Required Methods§
fn create( &self, tenant: &TenantId, project: &ProjectId, user: &UserTokenClaims, fhir_version: &SupportedFHIRVersions, resource: Resource, ) -> impl Future<Output = Result<Resource, OperationOutcomeError>> + Send
fn update( &self, tenant: &TenantId, project: &ProjectId, user: &UserTokenClaims, fhir_version: &SupportedFHIRVersions, resource: Resource, id: &str, ) -> impl Future<Output = Result<Resource, OperationOutcomeError>> + Send
fn delete( &self, tenant: &TenantId, project: &ProjectId, user: &UserTokenClaims, fhir_version: &SupportedFHIRVersions, resource: Resource, id: &str, ) -> impl Future<Output = Result<Resource, OperationOutcomeError>> + Send
fn read_by_version_ids( &self, tenant_id: &TenantId, project_id: &ProjectId, version_id: &[&VersionId], cache_policy: CachePolicy, ) -> impl Future<Output = Result<Vec<Resource>, OperationOutcomeError>> + Send
fn read_latest( &self, tenant_id: &TenantId, project_id: &ProjectId, resource_type: &ResourceType, resource_id: &ResourceId, ) -> impl Future<Output = Result<Option<Resource>, OperationOutcomeError>> + Send
Sourcefn read_latest_many(
&self,
tenant_id: &TenantId,
project_id: &ProjectId,
keys: &[(ResourceType, ResourceId)],
) -> impl Future<Output = Result<Vec<Resource>, OperationOutcomeError>> + Send
fn read_latest_many( &self, tenant_id: &TenantId, project_id: &ProjectId, keys: &[(ResourceType, ResourceId)], ) -> impl Future<Output = Result<Vec<Resource>, OperationOutcomeError>> + Send
Self::read_latest for many keys in one round trip: the current
version of each (type, id) that exists and is not deleted, in no
particular order. A key that does not resolve is left out.
fn history( &self, tenant_id: &TenantId, project_id: &ProjectId, request: &HistoryRequest, ) -> impl Future<Output = Result<Vec<ResourceHistoryValue>, OperationOutcomeError>> + Send
fn transaction( &self, register: bool, ) -> impl Future<Output = Result<Self, OperationOutcomeError>> + Send
fn in_transaction(&self) -> bool
fn commit( self, ) -> impl Future<Output = Result<(), OperationOutcomeError>> + Send
fn rollback( self, ) -> impl Future<Output = Result<(), OperationOutcomeError>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".