Trait poem_openapi::ApiExtractor [−][src]
pub trait ApiExtractor<'a>: Sized {
type ParamType;
type ParamRawType;
const TYPE: ApiExtractorType;
const PARAM_IS_REQUIRED: bool;
fn from_request<'life0, 'async_trait>(
request: &'a Request,
body: &'life0 mut RequestBody,
param_opts: ExtractParamOptions<Self::ParamType>
) -> Pin<Box<dyn Future<Output = Result<Self, ParseRequestError>> + Send + 'async_trait>>
where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
fn register(registry: &mut Registry) { ... }
fn security_scheme() -> Option<&'static str> { ... }
fn param_in() -> Option<MetaParamIn> { ... }
fn param_schema_ref() -> Option<MetaSchemaRef> { ... }
fn request_meta() -> Option<MetaRequest> { ... }
fn param_raw_type(&self) -> Option<&Self::ParamRawType> { ... }
}
Expand description
Represents a OpenAPI extractor.
Associated Types
type ParamRawType
type ParamRawType
The raw parameter type for validators.
Associated Constants
const TYPE: ApiExtractorType
const TYPE: ApiExtractorType
The type of API extractor.
const PARAM_IS_REQUIRED: bool
const PARAM_IS_REQUIRED: bool
If it is true
, it means that this parameter is required.
Required methods
fn from_request<'life0, 'async_trait>(
request: &'a Request,
body: &'life0 mut RequestBody,
param_opts: ExtractParamOptions<Self::ParamType>
) -> Pin<Box<dyn Future<Output = Result<Self, ParseRequestError>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn from_request<'life0, 'async_trait>(
request: &'a Request,
body: &'life0 mut RequestBody,
param_opts: ExtractParamOptions<Self::ParamType>
) -> Pin<Box<dyn Future<Output = Result<Self, ParseRequestError>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Parse from the HTTP request.
Provided methods
fn security_scheme() -> Option<&'static str>
fn security_scheme() -> Option<&'static str>
Returns name of security scheme if this extractor is security scheme.
Returns the location of the parameter if this extractor is parameter.
fn param_schema_ref() -> Option<MetaSchemaRef>
fn param_schema_ref() -> Option<MetaSchemaRef>
Returns the schema of the parameter if this extractor is parameter.
fn request_meta() -> Option<MetaRequest>
fn request_meta() -> Option<MetaRequest>
Returns MetaRequest
if this extractor is request object.
fn param_raw_type(&self) -> Option<&Self::ParamRawType>
fn param_raw_type(&self) -> Option<&Self::ParamRawType>
Returns a reference to the raw type of this parameter.