@@ -23,8 +23,6 @@ pub use embedded_svc_compat::*;
23
23
pub const DEFAULT_HANDLER_TASKS_COUNT : usize = 4 ;
24
24
pub const DEFAULT_BUF_SIZE : usize = 2048 ;
25
25
26
- pub mod registration;
27
-
28
26
const COMPLETION_BUF_SIZE : usize = 64 ;
29
27
30
28
/// A connection state machine for handling HTTP server requests-response cycles.
@@ -680,14 +678,11 @@ mod embedded_svc_compat {
680
678
use embedded_io_async:: { Read , Write } ;
681
679
682
680
use embedded_svc:: http:: server:: asynch:: { Connection , Headers , Query } ;
683
- use embedded_svc:: utils:: http:: server:: registration:: { ChainHandler , ChainRoot } ;
684
681
685
682
use crate :: io:: Body ;
686
683
use crate :: RequestHeaders ;
687
684
688
- use super :: * ;
689
-
690
- impl < ' b , T , const N : usize > Headers for super :: Connection < ' b , T , N >
685
+ impl < T , const N : usize > Headers for super :: Connection < ' _ , T , N >
691
686
where
692
687
T : Read + Write ,
693
688
{
@@ -699,7 +694,7 @@ mod embedded_svc_compat {
699
694
}
700
695
}
701
696
702
- impl < ' b , T , const N : usize > Query for super :: Connection < ' b , T , N >
697
+ impl < T , const N : usize > Query for super :: Connection < ' _ , T , N >
703
698
where
704
699
T : Read + Write ,
705
700
{
@@ -755,47 +750,33 @@ mod embedded_svc_compat {
755
750
}
756
751
}
757
752
758
- impl < ' b , T , const N : usize > Handler < ' b , T , N > for ChainRoot
759
- where
760
- T : Read + Write ,
761
- {
762
- type Error = Error < T :: Error > ;
763
-
764
- async fn handle (
765
- & self ,
766
- _task_id : impl core:: fmt:: Display + Copy ,
767
- connection : & mut super :: Connection < ' b , T , N > ,
768
- ) -> Result < ( ) , Self :: Error > {
769
- connection. initiate_response ( 404 , None , & [ ] ) . await
770
- }
771
- }
772
-
773
- impl < ' b , const N : usize , T , H , Q > Handler < ' b , T , N > for ChainHandler < H , Q >
774
- where
775
- H : embedded_svc:: http:: server:: asynch:: Handler < super :: Connection < ' b , T , N > > ,
776
- Q : Handler < ' b , T , N > ,
777
- Q :: Error : Into < H :: Error > ,
778
- T : Read + Write ,
779
- {
780
- type Error = H :: Error ;
781
-
782
- async fn handle (
783
- & self ,
784
- task_id : impl core:: fmt:: Display + Copy ,
785
- connection : & mut super :: Connection < ' b , T , N > ,
786
- ) -> Result < ( ) , Self :: Error > {
787
- let headers = connection. headers ( ) . ok ( ) ;
788
-
789
- if let Some ( headers) = headers {
790
- if headers. path == self . path && headers. method == self . method . into ( ) {
791
- return self . handler . handle ( connection) . await ;
792
- }
793
- }
794
-
795
- self . next
796
- . handle ( task_id, connection)
797
- . await
798
- . map_err ( Into :: into)
799
- }
800
- }
753
+ // NOTE: Currently, the `edge-http` and the `embedded-svc` Handler traits are
754
+ // incompatible, in that the `edge-http` async `Handler`'s `handle` method is generic,
755
+ // while the `embedded-svc` `Handler`'s `handle` method is not.
756
+ //
757
+ // Code below is commented out until `embedded-svc`'s `Handler` signature is changed
758
+ // to match the `edge-http` `Handler` signature.
759
+
760
+ // pub struct SvcHandler<H>(H);
761
+
762
+ // impl<'b, T, const N: usize, H> Handler for SvcHandler<H>
763
+ // where
764
+ // H: embedded_svc::http::server::asynch::Handler<super::Connection<'b, T, N>>,
765
+ // T: Read + Write,
766
+ // {
767
+ // type Error<E> = Error<E> where E: Debug;
768
+
769
+ // async fn handle<T, const N: usize>(
770
+ // &self,
771
+ // _task_id: impl core::fmt::Display + Copy,
772
+ // connection: &mut super::Connection<'_, T, N>,
773
+ // ) -> Result<(), Self::Error<T::Error>>
774
+ // where
775
+ // T: Read + Write,
776
+ // {
777
+ // self.0.handle(connection).await.unwrap();
778
+
779
+ // Ok(())
780
+ // }
781
+ // }
801
782
}
0 commit comments