@@ -30,13 +30,6 @@ macro_rules! associated_fn {
30
30
( $( $item: tt) * ) => ( $( $item) * ; )
31
31
}
32
32
33
- /// Helper methods defined by `Server` types not invoked over RPC.
34
- pub trait Context : Types {
35
- fn def_site ( & mut self ) -> Self :: Span ;
36
- fn call_site ( & mut self ) -> Self :: Span ;
37
- fn mixed_site ( & mut self ) -> Self :: Span ;
38
- }
39
-
40
33
macro_rules! declare_server_traits {
41
34
( $( $name: ident {
42
35
$( fn $method: ident( $( $arg: ident: $arg_ty: ty) ,* $( , ) ?) $( -> $ret_ty: ty) ?; ) *
@@ -45,23 +38,26 @@ macro_rules! declare_server_traits {
45
38
$( associated_fn!( fn $method( & mut self , $( $arg: $arg_ty) ,* ) $( -> $ret_ty) ?) ; ) *
46
39
} ) *
47
40
48
- pub trait Server : Types + Context $( + $name) * { }
49
- impl <S : Types + Context $( + $name) * > Server for S { }
41
+ pub trait Server : Types $( + $name) * {
42
+ fn def_site( & mut self ) -> Self :: Span ;
43
+ fn call_site( & mut self ) -> Self :: Span ;
44
+ fn mixed_site( & mut self ) -> Self :: Span ;
45
+ }
50
46
}
51
47
}
52
48
with_api ! ( Self , self_, declare_server_traits) ;
53
49
54
50
pub ( super ) struct MarkedTypes < S : Types > ( S ) ;
55
51
56
- impl < S : Context > Context for MarkedTypes < S > {
52
+ impl < S : Server > Server for MarkedTypes < S > {
57
53
fn def_site ( & mut self ) -> Self :: Span {
58
- <_ >:: mark ( Context :: def_site ( & mut self . 0 ) )
54
+ <_ >:: mark ( Server :: def_site ( & mut self . 0 ) )
59
55
}
60
56
fn call_site ( & mut self ) -> Self :: Span {
61
- <_ >:: mark ( Context :: call_site ( & mut self . 0 ) )
57
+ <_ >:: mark ( Server :: call_site ( & mut self . 0 ) )
62
58
}
63
59
fn mixed_site ( & mut self ) -> Self :: Span {
64
- <_ >:: mark ( Context :: mixed_site ( & mut self . 0 ) )
60
+ <_ >:: mark ( Server :: mixed_site ( & mut self . 0 ) )
65
61
}
66
62
}
67
63
0 commit comments