pub trait DatasetResolver: Send + Sync {
// Required methods
fn resolve_datasets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
datasets: &'life1 [String],
user_id: Uuid,
permission: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, CognifyError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn get_dataset_data<'life0, 'async_trait>(
&'life0 self,
dataset_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Data>, CognifyError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided method
fn resolve_dataset_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: Uuid,
_user_id: Uuid,
_permission: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, CognifyError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Required Methods§
Sourcefn resolve_datasets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
datasets: &'life1 [String],
user_id: Uuid,
permission: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, CognifyError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn resolve_datasets<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
datasets: &'life1 [String],
user_id: Uuid,
permission: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Dataset>, CognifyError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Resolve dataset names to Dataset objects for a given user.
- If
datasetsis empty, implementations should return all datasets the user has access to (matching Python behaviour whendatasets=None). permissionis a hint for access control (e.g."read","write").
Provided Methods§
Sourcefn resolve_dataset_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: Uuid,
_user_id: Uuid,
_permission: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, CognifyError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn resolve_dataset_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: Uuid,
_user_id: Uuid,
_permission: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Dataset>, CognifyError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Resolve a single dataset by its UUID.
Default implementation returns None (not supported). Implementors
backed by a real database should override.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".