Skip to content

Commit 2e610e0

Browse files
committed
dvc server and client trait bound
Signed-off-by: uchouT <i@uchout.moe>
1 parent 39b9337 commit 2e610e0

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

crates/ironrdp-dvc/src/client.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ pub trait DvcChannelListener: Send {
2929

3030
/// Called for each incoming DYNVC_CREATE_REQ matching this name.
3131
/// Return `None` to reject (NO_LISTENER).
32-
fn create(&mut self, channel_id: DynamicChannelId) -> Option<Box<dyn DvcProcessor>>;
32+
fn create(&mut self, channel_id: DynamicChannelId) -> Option<Box<dyn DvcClientProcessor>>;
3333
}
3434

3535
pub type DynamicChannelListener = Box<dyn DvcChannelListener>;
3636

3737
/// For pre-registered DVC
3838
struct OnceListener {
39-
inner: Option<Box<dyn DvcProcessor>>,
39+
inner: Option<Box<dyn DvcClientProcessor>>,
4040
}
4141

4242
impl OnceListener {
43-
fn new(dvc_processor: impl DvcProcessor + 'static) -> Self {
43+
fn new(dvc_processor: impl DvcClientProcessor + 'static) -> Self {
4444
Self {
4545
inner: Some(Box::new(dvc_processor)),
4646
}
@@ -55,13 +55,13 @@ impl DvcChannelListener for OnceListener {
5555
.channel_name()
5656
}
5757

58-
fn create(&mut self, _channel_id: DynamicChannelId) -> Option<Box<dyn DvcProcessor>> {
58+
fn create(&mut self, _channel_id: DynamicChannelId) -> Option<Box<dyn DvcClientProcessor>> {
5959
self.inner.take()
6060
}
6161
}
6262

6363
struct DynamicVirtualChannel {
64-
channel_processor: Box<dyn DvcProcessor + Send>,
64+
channel_processor: Box<dyn DvcClientProcessor + Send>,
6565
complete_data: CompleteData,
6666
/// The channel ID assigned by the server.
6767
///
@@ -78,7 +78,7 @@ impl Drop for DynamicVirtualChannel {
7878
}
7979

8080
impl DynamicVirtualChannel {
81-
fn from_boxed(processor: Box<dyn DvcProcessor + Send>) -> Self {
81+
fn from_boxed(processor: Box<dyn DvcClientProcessor + Send>) -> Self {
8282
Self {
8383
channel_processor: processor,
8484
complete_data: CompleteData::new(),
@@ -155,7 +155,7 @@ impl DrdynvcClient {
155155
#[must_use]
156156
pub fn with_dynamic_channel<T>(mut self, channel: T) -> Self
157157
where
158-
T: DvcProcessor + 'static,
158+
T: DvcClientProcessor + 'static,
159159
{
160160
self.dynamic_channels.register_once(channel);
161161
self
@@ -170,7 +170,7 @@ impl DrdynvcClient {
170170
/// it will be silently overwritten.
171171
pub fn attach_dynamic_channel<T>(&mut self, channel: T)
172172
where
173-
T: DvcProcessor + 'static,
173+
T: DvcClientProcessor + 'static,
174174
{
175175
self.dynamic_channels.register_once(channel);
176176
}
@@ -393,7 +393,7 @@ impl DynamicChannelSet {
393393
);
394394
}
395395

396-
fn register_once<T: DvcProcessor + 'static>(&mut self, channel: T) {
396+
fn register_once<T: DvcClientProcessor + 'static>(&mut self, channel: T) {
397397
let name = channel.channel_name().to_owned();
398398
self.listeners.insert(
399399
name,

crates/ironrdp-dvc/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ enum ChannelState {
2929

3030
struct DynamicChannel {
3131
state: ChannelState,
32-
processor: Box<dyn DvcProcessor>,
32+
processor: Box<dyn DvcServerProcessor>,
3333
complete_data: CompleteData,
3434
channel_id: u32,
3535
}

ffi/src/connector/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub mod ffi {
1010
use diplomat_runtime::DiplomatWriteable;
1111
use ironrdp::connector::Sequence as _;
1212
use ironrdp::displaycontrol::client::DisplayControlClient;
13-
use ironrdp::dvc::DvcProcessor;
13+
use ironrdp::dvc::DvcClientProcessor;
1414
use ironrdp_dvc_pipe_proxy::DvcNamedPipeProxy;
1515
use tracing::info;
1616

@@ -74,7 +74,7 @@ pub mod ffi {
7474

7575
fn with_dvc<T>(&mut self, processor: T) -> Result<(), Box<IronRdpError>>
7676
where
77-
T: DvcProcessor + 'static,
77+
T: DvcClientProcessor + 'static,
7878
{
7979
let Some(connector) = &mut self.0 else {
8080
return Err(ValueConsumedError::for_item("connector").into());

0 commit comments

Comments
 (0)