@@ -5,7 +5,7 @@ use std::collections::BTreeMap;
55use heck:: ToKebabCase ;
66use openapiv3:: OpenAPI ;
77use proc_macro2:: TokenStream ;
8- use quote:: { format_ident, quote} ;
8+ use quote:: { format_ident, quote, ToTokens } ;
99use typify:: { Type , TypeEnumVariant , TypeSpaceImpl , TypeStructPropInfo } ;
1010
1111use crate :: {
@@ -79,6 +79,13 @@ impl Generator {
7979 path : syn:: parse_str ( crate_name) . unwrap ( ) ,
8080 } ;
8181
82+ let cli_bounds: Vec < _ > = self
83+ . settings
84+ . extra_cli_bounds
85+ . iter ( )
86+ . map ( |b| syn:: parse_str :: < syn:: Path > ( b) . unwrap ( ) . into_token_stream ( ) )
87+ . collect ( ) ;
88+
8289 let code = quote ! {
8390 use #crate_path:: * ;
8491
@@ -125,24 +132,24 @@ impl Generator {
125132 pub trait CliConfig {
126133 fn success_item<T >( & self , value: & ResponseValue <T >)
127134 where
128- T : schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
135+ T : # ( #cli_bounds+ ) * schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
129136 fn success_no_item( & self , value: & ResponseValue <( ) >) ;
130137 fn error<T >( & self , value: & Error <T >)
131138 where
132- T : schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
139+ T : # ( #cli_bounds+ ) * schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
133140
134141 fn list_start<T >( & self )
135142 where
136- T : schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
143+ T : # ( #cli_bounds+ ) * schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
137144 fn list_item<T >( & self , value: & T )
138145 where
139- T : schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
146+ T : # ( #cli_bounds+ ) * schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
140147 fn list_end_success<T >( & self )
141148 where
142- T : schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
149+ T : # ( #cli_bounds+ ) * schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
143150 fn list_end_error<T >( & self , value: & Error <T >)
144151 where
145- T : schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
152+ T : # ( #cli_bounds+ ) * schemars:: JsonSchema + serde:: Serialize + std:: fmt:: Debug ;
146153
147154 #( #trait_ops) *
148155 }
0 commit comments