added ApiSelectionResponse
trait
This commit is contained in:
parent
e93b3529cb
commit
dc176a4c60
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-api-macros"
|
name = "torn-api-macros"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Pyrit [2111649]"]
|
authors = ["Pyrit [2111649]"]
|
||||||
license = "MIT"
|
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 {
|
impl crate::ApiSelection for #name {
|
||||||
type Response = Response;
|
type Response = Response;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-api"
|
name = "torn-api"
|
||||||
version = "0.7.1"
|
version = "0.7.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75.0"
|
rust-version = "1.75.0"
|
||||||
authors = ["Pyrit [2111649]"]
|
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 {
|
pub trait ApiSelection: Send + Sync + 'static {
|
||||||
type Response: From<ApiResponse> + Send + Sync;
|
type Response: ApiSelectionResponse;
|
||||||
|
|
||||||
fn raw_value(self) -> &'static str;
|
fn raw_value(self) -> &'static str;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue