Skip to main content

extract_with_state

Function extract_with_state 

Source
pub async fn extract_with_state<T, S>(state: &S) -> Result<T, ServerFnErrorErr>
Expand description

A helper to make it easier to use Axum extractors in server functions. This function is compatible with extractors that require access to State.

It is generic over some type T that implements FromRequestParts and can therefore be used in an extractor. The compiler can often infer this type.

Any error that occurs during extraction is converted to a ServerFnError.