mirror of https://github.com/rwf2/Rocket.git
Make 'ws::Stream![]' mean 'ws::Stream!['static]'.
This is in line with the stream macros in Rocket core.
This commit is contained in:
parent
1d2cc257dc
commit
847e87d5c9
|
@ -17,7 +17,7 @@ fn echo_manual<'r>(ws: ws::WebSocket) -> ws::Channel<'r> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/echo")]
|
#[get("/echo")]
|
||||||
fn echo_stream<'r>(ws: ws::WebSocket) -> ws::Stream!['r] {
|
fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] {
|
||||||
ws::stream! { ws =>
|
ws::stream! { ws =>
|
||||||
for await message in ws {
|
for await message in ws {
|
||||||
yield message?;
|
yield message?;
|
||||||
|
|
|
@ -132,11 +132,12 @@ impl<'r, S> IoHandler for MessageStream<'r, S>
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! Stream {
|
macro_rules! Stream {
|
||||||
|
() => (Stream!['static]);
|
||||||
($l:lifetime) => (
|
($l:lifetime) => (
|
||||||
$crate::ws::MessageStream<$l, impl rocket::futures::Stream<
|
$crate::ws::MessageStream<$l, impl rocket::futures::Stream<
|
||||||
Item = $crate::ws::Result<$crate::ws::Message>
|
Item = $crate::ws::Result<$crate::ws::Message>
|
||||||
> + $l>
|
> + $l>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
Loading…
Reference in New Issue