Skip to content

Commit 1cd212d

Browse files
Junha Yangjunha1
authored andcommitted
Move HandleToExchange to export_import.rs
It is paired with Skeleton. More natural to be there
1 parent 8aaa59b commit 1cd212d

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

remote-trait-object/src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ impl Context {
184184
let port_weak = Arc::downgrade(&port) as Weak<dyn Port>;
185185
let meta_service = <Box<dyn MetaService> as ImportProxy<dyn MetaService>>::import_proxy(
186186
Weak::clone(&port_weak),
187-
crate::service::HandleToExchange(crate::forwarder::META_SERVICE_OBJECT_ID),
187+
HandleToExchange(crate::forwarder::META_SERVICE_OBJECT_ID),
188188
);
189-
let initial_handle = crate::service::HandleToExchange(crate::forwarder::INITIAL_SERVICE_OBJECT_ID);
189+
let initial_handle = HandleToExchange(crate::forwarder::INITIAL_SERVICE_OBJECT_ID);
190190

191191
let ctx = Context {
192192
config,

remote-trait-object/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ pub mod raw_exchange {
3636
//! This module is needed only you want to perform some raw exchange (or export/import) of services.
3737
3838
pub use crate::service::export_import::{
39-
export_service_into_handle, import_service_from_handle, ImportProxy, IntoSkeleton, Skeleton,
39+
export_service_into_handle, import_service_from_handle, HandleToExchange, ImportProxy, IntoSkeleton, Skeleton,
4040
};
41-
pub use crate::service::HandleToExchange;
4241
}
4342

4443
#[doc(hidden)]

remote-trait-object/src/port.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub use self::types::Handler;
2222
use crate::forwarder::ServiceForwarder;
2323
use crate::forwarder::{ServiceObjectId, DELETE_REQUEST};
2424
use crate::packet::{Packet, PacketView};
25-
use crate::raw_exchange::Skeleton;
25+
use crate::raw_exchange::{HandleToExchange, Skeleton};
2626
use crate::service::*;
2727
use crate::Config;
2828
use client::Client;

remote-trait-object/src/service.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,12 @@ pub mod serde_support;
2222

2323
use crate::forwarder::ServiceObjectId;
2424
use crate::port::Port;
25-
use serde::{Deserialize, Serialize};
2625
use std::sync::Weak;
2726

2827
pub use handle::Handle;
2928
pub use null::{create_null_service, NullService};
3029
pub type MethodId = u32;
3130

32-
/// This represents transportable identifier of the service object
33-
/// and should be enough to construct a handle along with the pointer to the port
34-
/// which this service belong to
35-
#[derive(PartialEq, Serialize, Deserialize, Debug, Clone, Copy)]
36-
pub struct HandleToExchange(pub(crate) ServiceObjectId);
37-
3831
/// Exporter sides's interface to the service object. This will be implemented
3932
/// by each service trait's unique wrapper in the macro
4033
pub trait Dispatch: Send + Sync {

remote-trait-object/src/service/export_import.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@
1616

1717
use super::Dispatch;
1818
use super::*;
19+
use serde::{Deserialize, Serialize};
1920
use std::sync::Arc;
2021

22+
/// This represents transportable identifier of the service object
23+
/// and should be enough to construct a handle along with the pointer to the port
24+
/// which this service belong to
25+
#[derive(PartialEq, Serialize, Deserialize, Debug, Clone, Copy)]
26+
pub struct HandleToExchange(pub(crate) ServiceObjectId);
27+
2128
pub struct Skeleton {
2229
pub(crate) raw: Arc<dyn Dispatch>,
2330
}

remote-trait-object/src/service/handle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use super::*;
1818
use crate::packet::Packet;
19+
use crate::raw_exchange::HandleToExchange;
1920
use crate::service::{MethodId, SerdeFormat};
2021

2122
/// Proxy service will carry this.

remote-trait-object/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use remote_trait_object_macro as rto_macro;
2222
use crate::forwarder::ServiceObjectId;
2323
use crate::packet::{Packet, PacketView};
2424
use crate::port::*;
25-
use crate::raw_exchange::{ImportProxy, IntoSkeleton};
25+
use crate::raw_exchange::{HandleToExchange, ImportProxy, IntoSkeleton};
2626
use crate::service::*;
2727
use parking_lot::Mutex;
2828
use std::collections::HashMap;

0 commit comments

Comments
 (0)