got rid of Arc<T> dispatch
This commit is contained in:
@@ -591,8 +591,8 @@ fn push_client_implementation(
|
||||
let handshake_item = quote_impl_item!(cx,
|
||||
pub fn handshake(&self) -> Result<(), ::ipc::Error> {
|
||||
let payload = ::ipc::Handshake {
|
||||
protocol_version: ::std::sync::Arc::<$endpoint>::protocol_version(),
|
||||
api_version: ::std::sync::Arc::<$endpoint>::api_version(),
|
||||
protocol_version: $endpoint::protocol_version(),
|
||||
api_version: $endpoint::api_version(),
|
||||
};
|
||||
|
||||
::ipc::invoke(
|
||||
@@ -834,7 +834,7 @@ fn implement_interface(
|
||||
};
|
||||
|
||||
let ipc_item = quote_item!(cx,
|
||||
impl $host_generics ::ipc::IpcInterface<$interface_endpoint> for ::std::sync::Arc<$interface_endpoint> $where_clause {
|
||||
impl $host_generics ::ipc::IpcInterface<$interface_endpoint> for $interface_endpoint $where_clause {
|
||||
fn dispatch<R>(&self, r: &mut R) -> Vec<u8>
|
||||
where R: ::std::io::Read
|
||||
{
|
||||
|
||||
@@ -75,4 +75,4 @@ impl HypervisorService {
|
||||
}
|
||||
}
|
||||
|
||||
impl ::ipc::IpcConfig<HypervisorService> for Arc<HypervisorService> {}
|
||||
impl ::ipc::IpcConfig<HypervisorService> for HypervisorService {}
|
||||
|
||||
@@ -33,7 +33,7 @@ const POLL_TIMEOUT: isize = 100;
|
||||
const CLIENT_CONNECTION_TIMEOUT: isize = 2500;
|
||||
|
||||
/// Generic worker to handle service (binded) sockets
|
||||
pub struct Worker<S: ?Sized> where Arc<S>: IpcInterface<S> {
|
||||
pub struct Worker<S: ?Sized> where S: IpcInterface<S> {
|
||||
service: Arc<S>,
|
||||
sockets: Vec<(Socket, Endpoint)>,
|
||||
polls: Vec<PollFd>,
|
||||
@@ -116,7 +116,7 @@ pub enum SocketError {
|
||||
RequestLink,
|
||||
}
|
||||
|
||||
impl<S: ?Sized> Worker<S> where Arc<S>: IpcInterface<S> {
|
||||
impl<S: ?Sized> Worker<S> where S: IpcInterface<S> {
|
||||
/// New worker over specified `service`
|
||||
pub fn new(service: &Arc<S>) -> Worker<S> {
|
||||
Worker::<S> {
|
||||
|
||||
Reference in New Issue
Block a user