proxy -> client
This commit is contained in:
parent
7097451323
commit
71de6b8849
@ -233,7 +233,7 @@ fn implement_dispatch_arm(cx: &ExtCtxt, builder: &aster::AstBuilder, index: u32,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn push_proxy_struct(cx: &ExtCtxt, builder: &aster::AstBuilder, item: &Item, push: &mut FnMut(Annotatable)) {
|
fn push_proxy_struct(cx: &ExtCtxt, builder: &aster::AstBuilder, item: &Item, push: &mut FnMut(Annotatable)) {
|
||||||
let proxy_ident = builder.id(format!("{}Proxy", item.ident.name.as_str()));
|
let proxy_ident = builder.id(format!("{}Client", item.ident.name.as_str()));
|
||||||
|
|
||||||
let proxy_struct_item = quote_item!(cx,
|
let proxy_struct_item = quote_item!(cx,
|
||||||
pub struct $proxy_ident <S: ::ipc::IpcSocket> {
|
pub struct $proxy_ident <S: ::ipc::IpcSocket> {
|
||||||
@ -252,7 +252,7 @@ fn push_proxy(
|
|||||||
push: &mut FnMut(Annotatable))
|
push: &mut FnMut(Annotatable))
|
||||||
{
|
{
|
||||||
push_proxy_struct(cx, builder, item, push);
|
push_proxy_struct(cx, builder, item, push);
|
||||||
push_proxy_implementation(cx, builder, dispatches, push);
|
push_proxy_implementation(cx, builder, dispatches, item, push);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn implement_proxy_method_body(
|
fn implement_proxy_method_body(
|
||||||
@ -421,6 +421,7 @@ fn push_proxy_implementation(
|
|||||||
cx: &ExtCtxt,
|
cx: &ExtCtxt,
|
||||||
builder: &aster::AstBuilder,
|
builder: &aster::AstBuilder,
|
||||||
dispatches: &[Dispatch],
|
dispatches: &[Dispatch],
|
||||||
|
item: &Item,
|
||||||
push: &mut FnMut(Annotatable))
|
push: &mut FnMut(Annotatable))
|
||||||
{
|
{
|
||||||
let mut index = -1i32;
|
let mut index = -1i32;
|
||||||
@ -428,10 +429,11 @@ fn push_proxy_implementation(
|
|||||||
.map(|dispatch| { index = index + 1; P(implement_proxy_method(cx, builder, index as u16, dispatch)) })
|
.map(|dispatch| { index = index + 1; P(implement_proxy_method(cx, builder, index as u16, dispatch)) })
|
||||||
.collect::<Vec<P<ast::ImplItem>>>();
|
.collect::<Vec<P<ast::ImplItem>>>();
|
||||||
|
|
||||||
|
let client_ident = builder.id(format!("{}Client", item.ident.name.as_str()));
|
||||||
let implement = quote_item!(cx,
|
let implement = quote_item!(cx,
|
||||||
impl<S> ServiceProxy<S> where S: ::ipc::IpcSocket {
|
impl<S> $client_ident<S> where S: ::ipc::IpcSocket {
|
||||||
pub fn new(socket: S) -> ServiceProxy<S> {
|
pub fn new(socket: S) -> $client_ident<S> {
|
||||||
ServiceProxy {
|
$client_ident {
|
||||||
socket: ::std::cell::RefCell::new(socket),
|
socket: ::std::cell::RefCell::new(socket),
|
||||||
phantom: ::std::marker::PhantomData,
|
phantom: ::std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user