Commit Graph

7 Commits

Author SHA1 Message Date
BlackDex f1a95ce1d9 Update 'tungstenite' to 0.19 in 'rocket-ws'. 2023-05-22 14:39:10 -07:00
Benedikt Weber 055ad107df Allow status customization in 'Forward' outcomes.
Prior to this commit, all forward outcomes resulted in a 404. This
commit changes request and data guards so that they are able to provide
a `Status` on `Forward` outcomes. The router uses this status, if the
final outcome is to forward, to identify the catcher to invoke.

The net effect is that guards can now customize the status code of a
forward and thus the error catcher invoked if the final outcome of a
request is to forward.

Resolves #1560.
2023-04-11 12:47:20 -07:00
Sergio Benitez 07ea3df0c2 Fix links to 'Stream!' in 'ws' rustdocs. 2023-04-05 09:58:21 -07:00
Sergio Benitez db96f670b7 Fix contrib 'ws' README formatting. 2023-04-04 15:37:22 -07:00
Sergio Benitez c3520fb4a1 Pin I/O handlers. Allow 'FnOnce' in 'ws' handlers.
This modifies the 'IoHandler::io()' method so that it takes a
'Pin<Box<Self>>', allowing handlers to move internally and assume that
the data is pinned.

The change is then used in the 'ws' contrib crate to allow 'FnOnce'
handlers instead of 'FnMut'. The net effect is that streams, such as
those crated by 'Stream!', are now allowed to move internally.
2023-04-04 15:33:46 -07:00
Sergio Benitez d9f86d8647 Fully document the 'ws' contrib crate. 2023-04-03 16:09:45 -07:00
Sergio Benitez 7d895eb9f6 Add initial implementation of 'rocket_ws'.
This provides WebSocket support in Rocket's official 'contrib'.
2023-04-01 15:02:24 -07:00