pub struct RouteMetadata { /* private fields */ }Expand description
Static route metadata generated by route macros.
Implementations§
Source§impl RouteMetadata
impl RouteMetadata
Sourcepub const fn with_summary(
method: &'static str,
path: &'static str,
summary: &'static str,
) -> Self
pub const fn with_summary( method: &'static str, path: &'static str, summary: &'static str, ) -> Self
Creates route metadata with an OpenAPI summary.
Sourcepub const fn with_annotations(
method: &'static str,
path: &'static str,
summary: Option<&'static str>,
guards: &'static [&'static str],
pipes: &'static [&'static str],
validates: bool,
) -> Self
pub const fn with_annotations( method: &'static str, path: &'static str, summary: Option<&'static str>, guards: &'static [&'static str], pipes: &'static [&'static str], validates: bool, ) -> Self
Creates route metadata with all supported static annotations.
Sourcepub const fn with_openapi_annotations(
method: &'static str,
path: &'static str,
summary: Option<&'static str>,
tags: &'static [&'static str],
guards: &'static [&'static str],
pipes: &'static [&'static str],
validates: bool,
) -> Self
pub const fn with_openapi_annotations( method: &'static str, path: &'static str, summary: Option<&'static str>, tags: &'static [&'static str], guards: &'static [&'static str], pipes: &'static [&'static str], validates: bool, ) -> Self
Creates route metadata with all supported static annotations, including OpenAPI tags.
Sourcepub const fn with_openapi_schemas(
self,
request_schema: Option<&'static str>,
response_schema: Option<&'static str>,
) -> Self
pub const fn with_openapi_schemas( self, request_schema: Option<&'static str>, response_schema: Option<&'static str>, ) -> Self
Adds OpenAPI schema references to route metadata.
Sourcepub fn with_openapi_schema_registrars(
self,
request_schema: Option<OpenApiSchemaRegistrar>,
response_schema: Option<OpenApiSchemaRegistrar>,
) -> Self
pub fn with_openapi_schema_registrars( self, request_schema: Option<OpenApiSchemaRegistrar>, response_schema: Option<OpenApiSchemaRegistrar>, ) -> Self
Adds OpenAPI schema registration callbacks for route metadata.
Sourcepub const fn with_openapi_status(
self,
response_status: Option<StatusCode>,
) -> Self
pub const fn with_openapi_status( self, response_status: Option<StatusCode>, ) -> Self
Adds an OpenAPI success response status to route metadata.
Sourcepub const fn summary(&self) -> Option<&'static str>
pub const fn summary(&self) -> Option<&'static str>
Returns the OpenAPI summary, when declared.
Returns OpenAPI tags declared on the route.
Sourcepub const fn response_status(&self) -> Option<StatusCode>
pub const fn response_status(&self) -> Option<StatusCode>
Returns the OpenAPI success response status, when declared.
Sourcepub const fn request_schema(&self) -> Option<&'static str>
pub const fn request_schema(&self) -> Option<&'static str>
Returns the OpenAPI request schema reference name, when declared.
Sourcepub const fn response_schema(&self) -> Option<&'static str>
pub const fn response_schema(&self) -> Option<&'static str>
Returns the OpenAPI response schema reference name, when declared.
Sourcepub const fn request_schema_registrar(&self) -> Option<OpenApiSchemaRegistrar>
pub const fn request_schema_registrar(&self) -> Option<OpenApiSchemaRegistrar>
Returns the OpenAPI request schema registration callback, when declared.
Sourcepub const fn response_schema_registrar(&self) -> Option<OpenApiSchemaRegistrar>
pub const fn response_schema_registrar(&self) -> Option<OpenApiSchemaRegistrar>
Returns the OpenAPI response schema registration callback, when declared.
Sourcepub const fn guards(&self) -> &'static [&'static str]
pub const fn guards(&self) -> &'static [&'static str]
Returns guard type names declared on the route.
Sourcepub const fn pipes(&self) -> &'static [&'static str]
pub const fn pipes(&self) -> &'static [&'static str]
Returns pipe type names declared on the route.
Sourcepub fn full_path(&self, controller_prefix: &str) -> String
pub fn full_path(&self, controller_prefix: &str) -> String
Composes this route path with a controller prefix using Nidus path normalization.
Sourcepub fn try_full_path(
&self,
controller_prefix: &str,
) -> Result<String, RoutePathError>
pub fn try_full_path( &self, controller_prefix: &str, ) -> Result<String, RoutePathError>
Tries to compose this route path with a controller prefix using Nidus path normalization.
Trait Implementations§
Source§impl Clone for RouteMetadata
impl Clone for RouteMetadata
Source§fn clone(&self) -> RouteMetadata
fn clone(&self) -> RouteMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more