@@ -102,6 +102,8 @@ mod bindings {
102
102
"wasi:http/types/future-incoming-response" : latest:: http:: types:: FutureIncomingResponse ,
103
103
"wasi:http/types/future-trailers" : latest:: http:: types:: FutureTrailers ,
104
104
} ,
105
+ trappable_imports: true ,
106
+ skip_mut_forwarding_impls: true ,
105
107
} ) ;
106
108
}
107
109
@@ -149,35 +151,42 @@ where
149
151
T : WasiView + WasiHttpView ,
150
152
{
151
153
// interfaces from the "command" world
152
- wasi:: clocks:: monotonic_clock:: add_to_linker ( linker, |t| t) ?;
153
- wasi:: clocks:: wall_clock:: add_to_linker ( linker, |t| t) ?;
154
- wasi:: filesystem:: types:: add_to_linker ( linker, |t| t) ?;
155
- wasi:: filesystem:: preopens:: add_to_linker ( linker, |t| t) ?;
156
- wasi:: io:: poll:: add_to_linker ( linker, |t| t) ?;
157
- wasi:: io:: streams:: add_to_linker ( linker, |t| t) ?;
158
- wasi:: random:: random:: add_to_linker ( linker, |t| t) ?;
159
- wasi:: random:: insecure:: add_to_linker ( linker, |t| t) ?;
160
- wasi:: random:: insecure_seed:: add_to_linker ( linker, |t| t) ?;
161
- wasi:: cli:: exit:: add_to_linker ( linker, |t| t) ?;
162
- wasi:: cli:: environment:: add_to_linker ( linker, |t| t) ?;
163
- wasi:: cli:: stdin:: add_to_linker ( linker, |t| t) ?;
164
- wasi:: cli:: stdout:: add_to_linker ( linker, |t| t) ?;
165
- wasi:: cli:: stderr:: add_to_linker ( linker, |t| t) ?;
166
- wasi:: cli:: terminal_input:: add_to_linker ( linker, |t| t) ?;
167
- wasi:: cli:: terminal_output:: add_to_linker ( linker, |t| t) ?;
168
- wasi:: cli:: terminal_stdin:: add_to_linker ( linker, |t| t) ?;
169
- wasi:: cli:: terminal_stdout:: add_to_linker ( linker, |t| t) ?;
170
- wasi:: cli:: terminal_stderr:: add_to_linker ( linker, |t| t) ?;
171
- wasi:: sockets:: tcp:: add_to_linker ( linker, |t| t) ?;
172
- wasi:: sockets:: tcp_create_socket:: add_to_linker ( linker, |t| t) ?;
173
- wasi:: sockets:: udp:: add_to_linker ( linker, |t| t) ?;
174
- wasi:: sockets:: udp_create_socket:: add_to_linker ( linker, |t| t) ?;
175
- wasi:: sockets:: instance_network:: add_to_linker ( linker, |t| t) ?;
176
- wasi:: sockets:: network:: add_to_linker ( linker, |t| t) ?;
177
- wasi:: sockets:: ip_name_lookup:: add_to_linker ( linker, |t| t) ?;
178
-
179
- wasi:: http:: types:: add_to_linker ( linker, |t| t) ?;
180
- wasi:: http:: outgoing_handler:: add_to_linker ( linker, |t| t) ?;
154
+ fn project < T , F > ( f : F ) -> F
155
+ where
156
+ F : Fn ( & mut T ) -> & mut T ,
157
+ {
158
+ f
159
+ }
160
+ let closure = project :: < T , _ > ( |t| t) ;
161
+ wasi:: clocks:: monotonic_clock:: add_to_linker_get_host ( linker, closure) ?;
162
+ wasi:: clocks:: wall_clock:: add_to_linker_get_host ( linker, closure) ?;
163
+ wasi:: filesystem:: types:: add_to_linker_get_host ( linker, closure) ?;
164
+ wasi:: filesystem:: preopens:: add_to_linker_get_host ( linker, closure) ?;
165
+ wasi:: io:: poll:: add_to_linker_get_host ( linker, closure) ?;
166
+ wasi:: io:: streams:: add_to_linker_get_host ( linker, closure) ?;
167
+ wasi:: random:: random:: add_to_linker_get_host ( linker, closure) ?;
168
+ wasi:: random:: insecure:: add_to_linker_get_host ( linker, closure) ?;
169
+ wasi:: random:: insecure_seed:: add_to_linker_get_host ( linker, closure) ?;
170
+ wasi:: cli:: exit:: add_to_linker_get_host ( linker, closure) ?;
171
+ wasi:: cli:: environment:: add_to_linker_get_host ( linker, closure) ?;
172
+ wasi:: cli:: stdin:: add_to_linker_get_host ( linker, closure) ?;
173
+ wasi:: cli:: stdout:: add_to_linker_get_host ( linker, closure) ?;
174
+ wasi:: cli:: stderr:: add_to_linker_get_host ( linker, closure) ?;
175
+ wasi:: cli:: terminal_input:: add_to_linker_get_host ( linker, closure) ?;
176
+ wasi:: cli:: terminal_output:: add_to_linker_get_host ( linker, closure) ?;
177
+ wasi:: cli:: terminal_stdin:: add_to_linker_get_host ( linker, closure) ?;
178
+ wasi:: cli:: terminal_stdout:: add_to_linker_get_host ( linker, closure) ?;
179
+ wasi:: cli:: terminal_stderr:: add_to_linker_get_host ( linker, closure) ?;
180
+ wasi:: sockets:: tcp:: add_to_linker_get_host ( linker, closure) ?;
181
+ wasi:: sockets:: tcp_create_socket:: add_to_linker_get_host ( linker, closure) ?;
182
+ wasi:: sockets:: udp:: add_to_linker_get_host ( linker, closure) ?;
183
+ wasi:: sockets:: udp_create_socket:: add_to_linker_get_host ( linker, closure) ?;
184
+ wasi:: sockets:: instance_network:: add_to_linker_get_host ( linker, closure) ?;
185
+ wasi:: sockets:: network:: add_to_linker_get_host ( linker, closure) ?;
186
+ wasi:: sockets:: ip_name_lookup:: add_to_linker_get_host ( linker, closure) ?;
187
+
188
+ wasi:: http:: types:: add_to_linker_get_host ( linker, closure) ?;
189
+ wasi:: http:: outgoing_handler:: add_to_linker_get_host ( linker, closure) ?;
181
190
Ok ( ( ) )
182
191
}
183
192
@@ -1694,11 +1703,11 @@ where
1694
1703
}
1695
1704
}
1696
1705
1697
- impl < T > wasi:: http:: types:: Host for T where T : WasiHttpView { }
1706
+ impl < T > wasi:: http:: types:: Host for T where T : WasiHttpView + Send { }
1698
1707
1699
1708
impl < T > wasi:: http:: types:: HostFields for T
1700
1709
where
1701
- T : WasiHttpView ,
1710
+ T : WasiHttpView + Send ,
1702
1711
{
1703
1712
fn new (
1704
1713
& mut self ,
@@ -1768,7 +1777,7 @@ where
1768
1777
1769
1778
impl < T > wasi:: http:: types:: HostIncomingRequest for T
1770
1779
where
1771
- T : WasiHttpView ,
1780
+ T : WasiHttpView + Send ,
1772
1781
{
1773
1782
fn method (
1774
1783
& mut self ,
@@ -1823,7 +1832,7 @@ where
1823
1832
1824
1833
impl < T > wasi:: http:: types:: HostIncomingResponse for T
1825
1834
where
1826
- T : WasiHttpView ,
1835
+ T : WasiHttpView + Send ,
1827
1836
{
1828
1837
fn status (
1829
1838
& mut self ,
@@ -1856,7 +1865,7 @@ where
1856
1865
1857
1866
impl < T > wasi:: http:: types:: HostIncomingBody for T
1858
1867
where
1859
- T : WasiHttpView ,
1868
+ T : WasiHttpView + Send ,
1860
1869
{
1861
1870
fn stream (
1862
1871
& mut self ,
@@ -1879,7 +1888,7 @@ where
1879
1888
1880
1889
impl < T > wasi:: http:: types:: HostOutgoingRequest for T
1881
1890
where
1882
- T : WasiHttpView ,
1891
+ T : WasiHttpView + Send ,
1883
1892
{
1884
1893
fn new (
1885
1894
& mut self ,
@@ -1956,7 +1965,7 @@ where
1956
1965
1957
1966
impl < T > wasi:: http:: types:: HostOutgoingResponse for T
1958
1967
where
1959
- T : WasiHttpView ,
1968
+ T : WasiHttpView + Send ,
1960
1969
{
1961
1970
fn new (
1962
1971
& mut self ,
@@ -1996,7 +2005,7 @@ where
1996
2005
1997
2006
impl < T > wasi:: http:: types:: HostOutgoingBody for T
1998
2007
where
1999
- T : WasiHttpView ,
2008
+ T : WasiHttpView + Send ,
2000
2009
{
2001
2010
fn write (
2002
2011
& mut self ,
@@ -2021,7 +2030,7 @@ where
2021
2030
2022
2031
impl < T > wasi:: http:: types:: HostResponseOutparam for T
2023
2032
where
2024
- T : WasiHttpView ,
2033
+ T : WasiHttpView + Send ,
2025
2034
{
2026
2035
fn set (
2027
2036
& mut self ,
@@ -2053,7 +2062,7 @@ where
2053
2062
2054
2063
impl < T > wasi:: http:: types:: HostFutureTrailers for T
2055
2064
where
2056
- T : WasiHttpView ,
2065
+ T : WasiHttpView + Send ,
2057
2066
{
2058
2067
fn subscribe (
2059
2068
& mut self ,
@@ -2084,7 +2093,7 @@ where
2084
2093
2085
2094
impl < T > wasi:: http:: types:: HostFutureIncomingResponse for T
2086
2095
where
2087
- T : WasiHttpView ,
2096
+ T : WasiHttpView + Send ,
2088
2097
{
2089
2098
fn get (
2090
2099
& mut self ,
@@ -2117,7 +2126,7 @@ where
2117
2126
2118
2127
impl < T > wasi:: http:: outgoing_handler:: Host for T
2119
2128
where
2120
- T : WasiHttpView ,
2129
+ T : WasiHttpView + Send ,
2121
2130
{
2122
2131
fn handle (
2123
2132
& mut self ,
0 commit comments