ResourceProviderExt

Trait ResourceProviderExt 

Source
pub trait ResourceProviderExt: ResourceProvider {
    // Provided methods
    fn create_single_tenant(
        &self,
        resource_type: &str,
        data: Value,
        request_id: Option<String>,
    ) -> impl Future<Output = Result<VersionedResource, Self::Error>> + Send
       where Self: Sync { ... }
    fn get_single_tenant(
        &self,
        resource_type: &str,
        id: &str,
        request_id: Option<String>,
    ) -> impl Future<Output = Result<Option<VersionedResource>, Self::Error>> + Send
       where Self: Sync { ... }
    fn update_single_tenant(
        &self,
        resource_type: &str,
        id: &str,
        data: Value,
        expected_version: Option<&RawVersion>,
        request_id: Option<String>,
    ) -> impl Future<Output = Result<VersionedResource, Self::Error>> + Send
       where Self: Sync { ... }
    fn delete_single_tenant(
        &self,
        resource_type: &str,
        id: &str,
        expected_version: Option<&RawVersion>,
        request_id: Option<String>,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send
       where Self: Sync { ... }
}
Expand description

Extension trait providing convenience methods for ResourceProvider implementations.

This trait provides single-tenant convenience methods that automatically create the appropriate RequestContext for common scenarios.

Provided Methods§

Source

fn create_single_tenant( &self, resource_type: &str, data: Value, request_id: Option<String>, ) -> impl Future<Output = Result<VersionedResource, Self::Error>> + Send
where Self: Sync,

Convenience method for single-tenant resource creation.

Creates a RequestContext with no tenant information and calls create_resource.

Source

fn get_single_tenant( &self, resource_type: &str, id: &str, request_id: Option<String>, ) -> impl Future<Output = Result<Option<VersionedResource>, Self::Error>> + Send
where Self: Sync,

Convenience method for single-tenant resource retrieval.

Source

fn update_single_tenant( &self, resource_type: &str, id: &str, data: Value, expected_version: Option<&RawVersion>, request_id: Option<String>, ) -> impl Future<Output = Result<VersionedResource, Self::Error>> + Send
where Self: Sync,

Convenience method for single-tenant resource update.

Source

fn delete_single_tenant( &self, resource_type: &str, id: &str, expected_version: Option<&RawVersion>, request_id: Option<String>, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where Self: Sync,

Convenience method for single-tenant resource deletion.

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§