added ApiSelectionResponse
trait
This commit is contained in:
parent
0b353134f1
commit
9c49d2e316
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "torn-api-macros"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
edition = "2021"
|
||||
authors = ["Pyrit [2111649]"]
|
||||
license = "MIT"
|
||||
|
|
|
@ -153,6 +153,12 @@ fn impl_api_category(ast: &syn::DeriveInput) -> TokenStream {
|
|||
}
|
||||
}
|
||||
|
||||
impl crate::ApiSelectionResponse for Response {
|
||||
fn into_inner(self) -> crate::ApiResponse {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::ApiSelection for #name {
|
||||
type Response = Response;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "torn-api"
|
||||
version = "0.7.1"
|
||||
version = "0.7.2"
|
||||
edition = "2021"
|
||||
rust-version = "1.75.0"
|
||||
authors = ["Pyrit [2111649]"]
|
||||
|
|
|
@ -111,8 +111,12 @@ impl ApiResponse {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait ApiSelectionResponse: Send + Sync + From<ApiResponse> + 'static {
|
||||
fn into_inner(self) -> ApiResponse;
|
||||
}
|
||||
|
||||
pub trait ApiSelection: Send + Sync + 'static {
|
||||
type Response: From<ApiResponse> + Send + Sync;
|
||||
type Response: ApiSelectionResponse;
|
||||
|
||||
fn raw_value(self) -> &'static str;
|
||||
|
||||
|
|
Loading…
Reference in a new issue