11use std:: io:: { Cursor , Read } ;
2+ #[ cfg( feature = "tokio-runtime" ) ]
23use std:: path:: Path ;
34use std:: pin:: Pin ;
45use std:: str:: FromStr ;
@@ -76,6 +77,11 @@ impl<C: Connect + std::fmt::Debug + 'static + Clone + Send + Sync> Connector for
7677 MultipartValue :: Text ( text) => {
7778 fields. push ( ( key, MultipartTemporaryValue :: Text ( text) ) )
7879 }
80+ #[ cfg( feature = "sidevm-runtime" ) ]
81+ MultipartValue :: Path { .. } => {
82+ return Err ( ErrorKind :: InvalidMultipartFilename . into ( ) ) ;
83+ }
84+ #[ cfg( feature = "tokio-runtime" ) ]
7985 MultipartValue :: Path { file_name, path } => {
8086 let file_name = file_name
8187 . or_else ( || {
@@ -157,6 +163,7 @@ impl<C: Connect + std::fmt::Debug + 'static + Clone + Send + Sync> Connector for
157163 }
158164}
159165
166+ #[ cfg( feature = "tokio-runtime" ) ]
160167pub fn default_connector ( ) -> Result < Box < dyn Connector > , Error > {
161168 #[ cfg( feature = "rustls" ) ]
162169 let connector = HttpsConnector :: with_native_roots ( ) ;
@@ -168,3 +175,12 @@ pub fn default_connector() -> Result<Box<dyn Connector>, Error> {
168175 Client :: builder ( ) . build ( connector) ,
169176 ) ) )
170177}
178+
179+ #[ cfg( feature = "sidevm-runtime" ) ]
180+ pub fn default_connector ( ) -> Result < Box < dyn Connector > , Error > {
181+ Ok ( Box :: new ( HyperConnector :: new (
182+ Client :: builder ( )
183+ . executor ( sidevm:: exec:: HyperExecutor )
184+ . build ( sidevm:: net:: HttpConnector ) ,
185+ ) ) )
186+ }
0 commit comments