got rid of the generic parameter for ipc interface

This commit is contained in:
NikVolf
2016-07-16 19:24:45 +02:00
parent 77bbab009e
commit c3ef5c10a3
8 changed files with 15 additions and 15 deletions

View File

@@ -768,7 +768,7 @@ fn ty_ident_map(original_ty: &P<Ty>) -> IdentMap {
ident_map
}
/// implements `IpcInterface<C>` for the given class `C`
/// implements `IpcInterface` for the given class `C`
fn implement_interface(
cx: &ExtCtxt,
builder: &aster::AstBuilder,
@@ -834,7 +834,7 @@ fn implement_interface(
};
let ipc_item = quote_item!(cx,
impl $host_generics ::ipc::IpcInterface<$interface_endpoint> for $interface_endpoint $where_clause {
impl $host_generics ::ipc::IpcInterface for $interface_endpoint $where_clause {
fn dispatch<R>(&self, r: &mut R) -> Vec<u8>
where R: ::std::io::Read
{

View File

@@ -75,4 +75,4 @@ impl HypervisorService {
}
}
impl ::ipc::IpcConfig<HypervisorService> for HypervisorService {}
impl ::ipc::IpcConfig for HypervisorService {}

View File

@@ -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 S: IpcInterface<S> {
pub struct Worker<S: ?Sized> where S: IpcInterface {
service: Arc<S>,
sockets: Vec<(Socket, Endpoint)>,
polls: Vec<PollFd>,
@@ -54,9 +54,9 @@ impl<S> GuardedSocket<S> where S: WithSocket<Socket> {
}
impl<S> Deref for GuardedSocket<S> where S: WithSocket<Socket> {
type Target = Arc<S>;
type Target = S;
fn deref(&self) -> &Arc<S> {
fn deref(&self) -> &S {
&self.client
}
}
@@ -116,7 +116,7 @@ pub enum SocketError {
RequestLink,
}
impl<S: ?Sized> Worker<S> where S: IpcInterface<S> {
impl<S: ?Sized> Worker<S> where S: IpcInterface {
/// New worker over specified `service`
pub fn new(service: &Arc<S>) -> Worker<S> {
Worker::<S> {

View File

@@ -29,7 +29,7 @@ pub struct Handshake {
/// Allows to configure custom version and custom handshake response for
/// ipc host
pub trait IpcConfig<I: ?Sized> {
pub trait IpcConfig {
/// Current service api version
/// Should be increased if any of the methods changes signature
fn api_version() -> Version {
@@ -60,7 +60,7 @@ pub enum Error {
/// Allows implementor to be attached to generic worker and dispatch rpc requests
/// over IPC
pub trait IpcInterface<I :?Sized> : IpcConfig<I> {
pub trait IpcInterface : IpcConfig {
/// reads the message from io, dispatches the call and returns serialized result
fn dispatch<R>(&self, r: &mut R) -> Vec<u8> where R: Read;