pub enum PGConnection {
Pool(Pool<Postgres>, Cache<VersionId, Resource>),
Transaction(Arc<Mutex<Transaction<'static, Postgres>>>, Cache<VersionId, Resource>),
}Expand description
Connection types supported by the repository traits.
Variants§
Pool(Pool<Postgres>, Cache<VersionId, Resource>)
Transaction(Arc<Mutex<Transaction<'static, Postgres>>>, Cache<VersionId, Resource>)
Implementations§
Trait Implementations§
Source§impl Clone for PGConnection
impl Clone for PGConnection
Source§fn clone(&self) -> PGConnection
fn clone(&self) -> PGConnection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PGConnection
impl Debug for PGConnection
Source§impl FHIRRepository for PGConnection
impl FHIRRepository for PGConnection
async fn create( &self, tenant: &TenantId, project: &ProjectId, author: &UserTokenClaims, fhir_version: &SupportedFHIRVersions, resource: &mut Resource, ) -> Result<Resource, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, project: &ProjectId, author: &UserTokenClaims, fhir_version: &SupportedFHIRVersions, resource: &mut Resource, id: &str, ) -> Result<Resource, OperationOutcomeError>
async fn update( &self, tenant: &TenantId, project: &ProjectId, author: &UserTokenClaims, fhir_version: &SupportedFHIRVersions, resource: &mut Resource, id: &str, ) -> Result<Resource, OperationOutcomeError>
async fn read_by_version_ids( &self, tenant_id: &TenantId, project_id: &ProjectId, version_ids: &[&VersionId], cache_policy: CachePolicy, ) -> Result<Vec<Resource>, OperationOutcomeError>
async fn read_latest( &self, tenant_id: &TenantId, project_id: &ProjectId, resource_type: &ResourceType, resource_id: &ResourceId, ) -> Result<Option<Resource>, OperationOutcomeError>
async fn history( &self, tenant_id: &TenantId, project_id: &ProjectId, request: &HistoryRequest, ) -> Result<Vec<Resource>, OperationOutcomeError>
async fn get_sequence( &self, tenant_id: &TenantId, sequence_id: u64, count: Option<u64>, ) -> Result<Vec<ResourcePollingValue>, OperationOutcomeError>
fn in_transaction(&self) -> bool
async fn transaction<'a>( &'a self, is_updating_sequence: bool, ) -> Result<Self, OperationOutcomeError>
async fn commit(self) -> Result<(), OperationOutcomeError>
async fn rollback(self) -> Result<(), OperationOutcomeError>
Source§impl Login for PGConnection
impl Login for PGConnection
async fn login( &self, tenant: &TenantId, method: &LoginMethod, ) -> Result<LoginResult, OperationOutcomeError>
Source§impl Migrate for PGConnection
impl Migrate for PGConnection
Source§impl<Key: AsRef<str> + Send + Sync> ProjectAuthAdmin<CreateAuthorizationCode, AuthorizationCode, AuthorizationCodeSearchClaims, AuthorizationCode, Key> for PGConnection
impl<Key: AsRef<str> + Send + Sync> ProjectAuthAdmin<CreateAuthorizationCode, AuthorizationCode, AuthorizationCodeSearchClaims, AuthorizationCode, Key> for PGConnection
async fn create( &self, tenant: &TenantId, project: &ProjectId, authorization_code: CreateAuthorizationCode, ) -> Result<AuthorizationCode, OperationOutcomeError>
async fn read( &self, tenant: &TenantId, project: &ProjectId, code: &Key, ) -> Result<Option<AuthorizationCode>, OperationOutcomeError>
async fn update( &self, _tenant: &TenantId, _project: &ProjectId, _model: AuthorizationCode, ) -> Result<AuthorizationCode, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, project: &ProjectId, code: &Key, ) -> Result<(), OperationOutcomeError>
async fn search( &self, tenant: &TenantId, project: &ProjectId, clauses: &AuthorizationCodeSearchClaims, ) -> Result<Vec<AuthorizationCode>, OperationOutcomeError>
Source§impl<Key: AsRef<str> + Send + Sync> ProjectAuthAdmin<CreateMembership, Membership, MembershipSearchClaims, Membership, Key> for PGConnection
impl<Key: AsRef<str> + Send + Sync> ProjectAuthAdmin<CreateMembership, Membership, MembershipSearchClaims, Membership, Key> for PGConnection
async fn create( &self, tenant: &TenantId, project: &ProjectId, new_membership: CreateMembership, ) -> Result<Membership, OperationOutcomeError>
async fn read( &self, tenant: &TenantId, project: &ProjectId, id: &Key, ) -> Result<Option<Membership>, OperationOutcomeError>
async fn update( &self, tenant: &TenantId, project: &ProjectId, model: Membership, ) -> Result<Membership, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, project: &ProjectId, id: &Key, ) -> Result<(), OperationOutcomeError>
async fn search( &self, tenant: &TenantId, project: &ProjectId, clauses: &MembershipSearchClaims, ) -> Result<Vec<Membership>, OperationOutcomeError>
Source§impl ProjectAuthAdmin<CreateScope, Scope, ScopeSearchClaims, UpdateScope, ScopeKey> for PGConnection
impl ProjectAuthAdmin<CreateScope, Scope, ScopeSearchClaims, UpdateScope, ScopeKey> for PGConnection
async fn create( &self, tenant: &TenantId, project: &ProjectId, new_scope: CreateScope, ) -> Result<Scope, OperationOutcomeError>
async fn read( &self, tenant: &TenantId, project: &ProjectId, key: &ScopeKey, ) -> Result<Option<Scope>, OperationOutcomeError>
async fn update( &self, tenant: &TenantId, project: &ProjectId, model: UpdateScope, ) -> Result<Scope, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, project: &ProjectId, key: &ScopeKey, ) -> Result<(), OperationOutcomeError>
async fn search( &self, tenant: &TenantId, project: &ProjectId, clauses: &ScopeSearchClaims, ) -> Result<Vec<Scope>, OperationOutcomeError>
Source§impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateAuthorizationCode, AuthorizationCode, AuthorizationCodeSearchClaims, AuthorizationCode, Key> for PGConnection
impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateAuthorizationCode, AuthorizationCode, AuthorizationCodeSearchClaims, AuthorizationCode, Key> for PGConnection
async fn create( &self, tenant: &TenantId, authorization_code: CreateAuthorizationCode, ) -> Result<AuthorizationCode, OperationOutcomeError>
async fn read( &self, tenant: &TenantId, code: &Key, ) -> Result<Option<AuthorizationCode>, OperationOutcomeError>
async fn update( &self, _tenant: &TenantId, _model: AuthorizationCode, ) -> Result<AuthorizationCode, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, code: &Key, ) -> Result<(), OperationOutcomeError>
async fn search( &self, tenant: &TenantId, clauses: &AuthorizationCodeSearchClaims, ) -> Result<Vec<AuthorizationCode>, OperationOutcomeError>
Source§impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateProject, Project, ProjectSearchClaims, Project, Key> for PGConnection
impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateProject, Project, ProjectSearchClaims, Project, Key> for PGConnection
async fn create( &self, tenant: &TenantId, new_project: CreateProject, ) -> Result<Project, OperationOutcomeError>
async fn read( &self, tenant: &TenantId, id: &Key, ) -> Result<Option<Project>, OperationOutcomeError>
async fn update( &self, tenant: &TenantId, model: Project, ) -> Result<Project, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, id: &Key, ) -> Result<(), OperationOutcomeError>
async fn search( &self, tenant: &TenantId, claims: &ProjectSearchClaims, ) -> Result<Vec<Project>, OperationOutcomeError>
Source§impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateTenant, Tenant, TenantSearchClaims, Tenant, Key> for PGConnection
impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateTenant, Tenant, TenantSearchClaims, Tenant, Key> for PGConnection
async fn create( &self, _tenant: &TenantId, new_tenant: CreateTenant, ) -> Result<Tenant, OperationOutcomeError>
async fn read( &self, _tenant: &TenantId, id: &Key, ) -> Result<Option<Tenant>, OperationOutcomeError>
async fn update( &self, _tenant: &TenantId, model: Tenant, ) -> Result<Tenant, OperationOutcomeError>
async fn delete( &self, _tenant: &TenantId, id: &Key, ) -> Result<(), OperationOutcomeError>
async fn search( &self, _tenant: &TenantId, claims: &TenantSearchClaims, ) -> Result<Vec<Tenant>, OperationOutcomeError>
Source§impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateUser, User, UserSearchClauses, UpdateUser, Key> for PGConnection
impl<Key: AsRef<str> + Send + Sync> TenantAuthAdmin<CreateUser, User, UserSearchClauses, UpdateUser, Key> for PGConnection
async fn create( &self, tenant: &TenantId, new_user: CreateUser, ) -> Result<User, OperationOutcomeError>
async fn read( &self, tenant: &TenantId, id: &Key, ) -> Result<Option<User>, OperationOutcomeError>
async fn update( &self, tenant: &TenantId, user: UpdateUser, ) -> Result<User, OperationOutcomeError>
async fn delete( &self, tenant: &TenantId, id: &Key, ) -> Result<(), OperationOutcomeError>
async fn search( &self, tenant: &TenantId, clauses: &UserSearchClauses, ) -> Result<Vec<User>, OperationOutcomeError>
impl Repository for PGConnection
Auto Trait Implementations§
impl Freeze for PGConnection
impl !RefUnwindSafe for PGConnection
impl Send for PGConnection
impl Sync for PGConnection
impl Unpin for PGConnection
impl !UnwindSafe for PGConnection
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more