File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,6 +161,10 @@ impl DrdynvcClient {
161161 self . dynamic_channels . get_by_channel_id ( channel_id)
162162 }
163163
164+ pub fn get_dvc_by_channel_id_mut ( & mut self , channel_id : u32 ) -> Option < & mut DynamicVirtualChannel > {
165+ self . dynamic_channels . get_by_channel_id_mut ( channel_id)
166+ }
167+
164168 fn create_capabilities_response ( & mut self , server_version : CapsVersion ) -> SvcMessage {
165169 let caps_response = DrdynvcClientPdu :: Capabilities ( CapabilitiesResponsePdu :: new ( server_version) ) ;
166170 debug ! ( "Send DVC Capabilities Response PDU: {caps_response:?}" ) ;
Original file line number Diff line number Diff line change @@ -138,10 +138,14 @@ impl DynamicVirtualChannel {
138138 self . channel_id
139139 }
140140
141- pub fn channel_processor_downcast_ref < T : DvcProcessor > ( & self ) -> Option < & T > {
141+ pub fn channel_processor_downcast_ref < T : DvcClientProcessor > ( & self ) -> Option < & T > {
142142 self . channel_processor . as_any ( ) . downcast_ref ( )
143143 }
144144
145+ pub fn channel_processor_downcast_mut < T : DvcClientProcessor > ( & mut self ) -> Option < & mut T > {
146+ self . channel_processor . as_any_mut ( ) . downcast_mut ( )
147+ }
148+
145149 fn start ( & mut self , channel_id : DynamicChannelId ) -> PduResult < Vec < DvcMessage > > {
146150 let messages = self . channel_processor . start ( channel_id) ?;
147151 self . channel_id = Some ( channel_id) ;
Original file line number Diff line number Diff line change @@ -186,6 +186,18 @@ impl DrdynvcServer {
186186 . ok_or_else ( || invalid_field_err ! ( "DRDYNVC" , "" , "invalid channel id" ) )
187187 }
188188
189+ pub fn dvc_by_id < T : DvcServerProcessor > ( & self , id : u32 ) -> Option < & T > {
190+ self . dynamic_channels
191+ . get ( id)
192+ . and_then ( |w| w. processor . as_any ( ) . downcast_ref ( ) )
193+ }
194+
195+ pub fn dvc_by_id_mut < T : DvcServerProcessor > ( & mut self , id : u32 ) -> Option < & mut T > {
196+ self . dynamic_channels
197+ . get_mut ( id)
198+ . and_then ( |c| c. processor . as_any_mut ( ) . downcast_mut ( ) )
199+ }
200+
189201 /// Creates a new DVC, returns CreateRequest PDU to send to client.
190202 ///
191203 /// # Panics
You can’t perform that action at this time.
0 commit comments