-
-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
A-socketioxideArea related to socketioxideArea related to socketioxideP-LowLow priorityLow priorityT-DocsTopic: documentationTopic: documentation
Description
Is your feature request related to a problem? Please describe.
I want to create a custom extrators for my app.
Describe the solution you'd like
Add an example of a extrator that access state.
Describe alternatives you've considered
Just docs
Additional context
I need to create my custom extrators but i found so far the following issues:
- When i implement
FromMessageParts
(or any of these handler traits), i can't get thejson_serde::Value
andbytes::Bytes
types (you should export these), i currently usingsqlx::types::JsonValue
andaxum::body::Bytes
. - If i need my custom extrator to access socket state, the only solution at the moment is to create the state from the current message (also for other type handlers) i.e.
State::<T>::from_message_parts(s, v, p, ack_id)
which returnsResult<Self, StateNotFound<T>>
, so i have consum the result and covert to option usingok()
, and finallyunwrap()
the option, which is safe in my context but i think we need a better way to do this kind of extractors (axum gets the state as parameter in thefrom_request_parts
function). - Also we need a way to multiple extrator like axums does i.e `Data((one, two, three)): Data<(TypeOne, TypeTwo, TypeThree)>
Totodore
Metadata
Metadata
Assignees
Labels
A-socketioxideArea related to socketioxideArea related to socketioxideP-LowLow priorityLow priorityT-DocsTopic: documentationTopic: documentation
Projects
Status
Todo