major refactoring

This commit is contained in:
TotallyNot 2024-04-04 15:59:10 +02:00
parent e8a8b5976b
commit 8aaf61efb1
10 changed files with 404 additions and 222 deletions

View file

@ -111,18 +111,14 @@ impl ApiResponse {
}
}
pub trait ApiSelection: Send + Sync {
pub trait ApiSelection: Send + Sync + 'static {
type Response: From<ApiResponse> + Send + Sync;
fn raw_value(self) -> &'static str;
fn category() -> &'static str;
}
pub trait ApiCategoryResponse: Send + Sync {
type Selection: ApiSelection;
fn from_response(response: ApiResponse) -> Self;
}
pub struct DirectExecutor<C> {
key: String,
_marker: std::marker::PhantomData<C>,