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§
Sourcefn create_single_tenant(
&self,
resource_type: &str,
data: Value,
request_id: Option<String>,
) -> impl Future<Output = Result<VersionedResource, Self::Error>> + Sendwhere
Self: Sync,
fn create_single_tenant(
&self,
resource_type: &str,
data: Value,
request_id: Option<String>,
) -> impl Future<Output = Result<VersionedResource, Self::Error>> + Sendwhere
Self: Sync,
Convenience method for single-tenant resource creation.
Creates a RequestContext with no tenant information and calls create_resource.
Sourcefn get_single_tenant(
&self,
resource_type: &str,
id: &str,
request_id: Option<String>,
) -> impl Future<Output = Result<Option<VersionedResource>, Self::Error>> + Sendwhere
Self: Sync,
fn get_single_tenant(
&self,
resource_type: &str,
id: &str,
request_id: Option<String>,
) -> impl Future<Output = Result<Option<VersionedResource>, Self::Error>> + Sendwhere
Self: Sync,
Convenience method for single-tenant resource retrieval.
Sourcefn 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>> + Sendwhere
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>> + Sendwhere
Self: Sync,
Convenience method for single-tenant resource update.
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.