File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
- //! ### Extractors for [`ConnectHandler`](super::ConnectHandler), [`MessageHandler`](super::MessageHandler)
1
+ //! ### Extractors for [`ConnectHandler`](super::ConnectHandler), [`ConnectMiddleware`](super::ConnectMiddleware),
2
+ //! [`MessageHandler`](super::MessageHandler)
2
3
//! and [`DisconnectHandler`](super::DisconnectHandler).
3
4
//!
4
5
//! They can be used to extract data from the context of the handler and get specific params. Here are some examples of extractors:
5
6
//! * [`Data`]: extracts and deserialize to json any data, if a deserialization error occurs the handler won't be called:
6
7
//! - for [`ConnectHandler`](super::ConnectHandler): extracts and deserialize to json the auth data
8
+ //! - for [`ConnectMiddleware`](super::ConnectMiddleware): extract and deserialize to json the auth data.
9
+ //! In case of error, the middleware chain stops and a `connect_error` event is sent.
7
10
//! - for [`MessageHandler`](super::MessageHandler): extracts and deserialize to json the message data
8
11
//! * [`TryData`]: extracts and deserialize to json any data but with a `Result` type in case of error:
9
- //! - for [`ConnectHandler`](super::ConnectHandler): extracts and deserialize to json the auth data
12
+ //! - for [`ConnectHandler`](super::ConnectHandler) and [`ConnectMiddleware`](super::ConnectMiddleware):
13
+ //! extracts and deserialize to json the auth data
10
14
//! - for [`MessageHandler`](super::MessageHandler): extracts and deserialize to json the message data
11
15
//! * [`SocketRef`]: extracts a reference to the [`Socket`]
12
16
//! * [`Bin`]: extract a binary payload for a given message. Because it consumes the event it should be the last argument
You can’t perform that action at this time.
0 commit comments