@@ -57,7 +57,7 @@ use hotfix_message::session_fields::{
5757
5858const SCHEDULE_CHECK_INTERVAL : u64 = 1 ;
5959
60- struct Session < A , O , S > {
60+ struct Session < A , S > {
6161 message_config : MessageConfig ,
6262 config : SessionConfig ,
6363 schedule : SessionSchedule ,
@@ -67,20 +67,18 @@ struct Session<A, O, S> {
6767 store : S ,
6868 schedule_check_timer : Pin < Box < Sleep > > ,
6969 reset_on_next_logon : bool ,
70- _phantom : std:: marker:: PhantomData < fn ( ) -> O > ,
7170}
7271
73- impl < App , Outbound , Store > Session < App , Outbound , Store >
72+ impl < App , Store > Session < App , Store >
7473where
75- App : Application < Outbound > ,
76- Outbound : OutboundMessage ,
74+ App : Application ,
7775 Store : MessageStore ,
7876{
7977 fn new (
8078 config : SessionConfig ,
8179 application : App ,
8280 store : Store ,
83- ) -> Result < Session < App , Outbound , Store > , SessionCreationError > {
81+ ) -> Result < Session < App , Store > , SessionCreationError > {
8482 let schedule_check_timer = sleep ( Duration :: from_secs ( SCHEDULE_CHECK_INTERVAL ) ) ;
8583
8684 let dictionary = Self :: get_data_dictionary ( & config) ?;
9896 store,
9997 schedule_check_timer : Box :: pin ( schedule_check_timer) ,
10098 reset_on_next_logon : false ,
101- _phantom : std:: marker:: PhantomData ,
10299 } ;
103100
104101 Ok ( session)
@@ -794,7 +791,7 @@ where
794791 . reset_peer_timer ( self . config . heartbeat_interval , test_request_id) ;
795792 }
796793
797- async fn send_app_message ( & mut self , message : Outbound ) -> Result < SendOutcome , SendError > {
794+ async fn send_app_message ( & mut self , message : App :: Outbound ) -> Result < SendOutcome , SendError > {
798795 if !self . state . is_connected ( ) {
799796 return Err ( SendError :: Disconnected ) ;
800797 }
@@ -981,7 +978,7 @@ where
981978 }
982979 }
983980
984- async fn handle_outbound_message ( & mut self , request : OutboundRequest < Outbound > ) {
981+ async fn handle_outbound_message ( & mut self , request : OutboundRequest < App :: Outbound > ) {
985982 let OutboundRequest { message, confirm } = request;
986983 let result = self . send_app_message ( message) . await ;
987984 match confirm {
@@ -1129,14 +1126,13 @@ fn get_msg_seq_num(message: &Message) -> u64 {
11291126 . expect ( "MsgSeqNum missing from validated message - parser bug" )
11301127}
11311128
1132- async fn run_session < App , Outbound , Store > (
1133- mut session : Session < App , Outbound , Store > ,
1129+ async fn run_session < App , Store > (
1130+ mut session : Session < App , Store > ,
11341131 mut event_receiver : mpsc:: Receiver < SessionEvent > ,
1135- mut outbound_message_receiver : mpsc:: Receiver < OutboundRequest < Outbound > > ,
1132+ mut outbound_message_receiver : mpsc:: Receiver < OutboundRequest < App :: Outbound > > ,
11361133 mut admin_request_receiver : mpsc:: Receiver < AdminRequest > ,
11371134) where
1138- App : Application < Outbound > ,
1139- Outbound : OutboundMessage ,
1135+ App : Application ,
11401136 Store : MessageStore + Send + ' static ,
11411137{
11421138 loop {
@@ -1294,7 +1290,9 @@ mod tests {
12941290 struct NoOpApp ;
12951291
12961292 #[ async_trait:: async_trait]
1297- impl Application < DummyMessage > for NoOpApp {
1293+ impl Application for NoOpApp {
1294+ type Outbound = DummyMessage ;
1295+
12981296 async fn on_outbound_message ( & self , _: & DummyMessage ) -> OutboundDecision {
12991297 OutboundDecision :: Send
13001298 }
@@ -1332,7 +1330,7 @@ mod tests {
13321330 schedule : SessionSchedule ,
13331331 state : SessionState ,
13341332 store : TestStore ,
1335- ) -> Session < NoOpApp , DummyMessage , TestStore > {
1333+ ) -> Session < NoOpApp , TestStore > {
13361334 let config = create_test_config ( ) ;
13371335 let message_config = MessageConfig :: default ( ) ;
13381336 let dictionary = Dictionary :: fix44 ( ) ;
@@ -1348,7 +1346,6 @@ mod tests {
13481346 store,
13491347 schedule_check_timer : Box :: pin ( sleep ( Duration :: from_secs ( 1 ) ) ) ,
13501348 reset_on_next_logon : false ,
1351- _phantom : std:: marker:: PhantomData ,
13521349 }
13531350 }
13541351
0 commit comments