Skip to content

Commit abf6368

Browse files
committed
feat(connector): add API to retrieve registered svc processors
1 parent 21fa028 commit abf6368

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/ironrdp-connector/src/connection.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,24 @@ impl ClientConnector {
154154
self.static_channels.insert(channel);
155155
}
156156

157+
pub fn get_static_channel_processor<T>(&mut self) -> Option<&T>
158+
where
159+
T: SvcClientProcessor + 'static,
160+
{
161+
self.static_channels
162+
.get_by_type::<T>()
163+
.and_then(|channel| channel.channel_processor_downcast_ref())
164+
}
165+
166+
pub fn get_static_channel_processor_mut<T>(&mut self) -> Option<&mut T>
167+
where
168+
T: SvcClientProcessor + 'static,
169+
{
170+
self.static_channels
171+
.get_by_type_mut::<T>()
172+
.and_then(|channel| channel.channel_processor_downcast_mut())
173+
}
174+
157175
pub fn should_perform_security_upgrade(&self) -> bool {
158176
matches!(self.state, ClientConnectorState::EnhancedSecurityUpgrade { .. })
159177
}

0 commit comments

Comments
 (0)