Skip to main content

ExportDataProvider

Trait ExportDataProvider 

Source
pub trait ExportDataProvider: Send + Sync {
    // Required methods
    fn list_export_types<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tenant: &'life1 TenantContext,
        request: &'life2 ExportRequest,
    ) -> Pin<Box<dyn Future<Output = StorageResult<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn count_export_resources<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tenant: &'life1 TenantContext,
        request: &'life2 ExportRequest,
        resource_type: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn fetch_export_batch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        tenant: &'life1 TenantContext,
        request: &'life2 ExportRequest,
        resource_type: &'life3 str,
        cursor: Option<&'life4 str>,
        batch_size: u32,
    ) -> Pin<Box<dyn Future<Output = StorageResult<NdjsonBatch>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
}
Expand description

Data provider for export operations.

This trait provides the data retrieval capabilities needed to perform system-level exports.

Required Methods§

Source

fn list_export_types<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tenant: &'life1 TenantContext, request: &'life2 ExportRequest, ) -> Pin<Box<dyn Future<Output = StorageResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Lists resource types available for export.

§Arguments
  • tenant - The tenant context
  • request - The export request (used to filter by requested types)
§Returns

List of resource type names that should be exported.

Source

fn count_export_resources<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tenant: &'life1 TenantContext, request: &'life2 ExportRequest, resource_type: &'life3 str, ) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Counts resources of a type for export.

§Arguments
  • tenant - The tenant context
  • request - The export request (for filters)
  • resource_type - The resource type to count
§Returns

The count of resources matching the export criteria.

Source

fn fetch_export_batch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, tenant: &'life1 TenantContext, request: &'life2 ExportRequest, resource_type: &'life3 str, cursor: Option<&'life4 str>, batch_size: u32, ) -> Pin<Box<dyn Future<Output = StorageResult<NdjsonBatch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Fetches a batch of resources for export.

§Arguments
  • tenant - The tenant context
  • request - The export request (for filters)
  • resource_type - The resource type to fetch
  • cursor - Cursor from previous batch, or None for first batch
  • batch_size - Maximum number of resources to return
§Returns

A batch of NDJSON lines with cursor for next batch.

Implementors§