pub struct EndpointGroup { /* private fields */ }Expand description
Endpoint group that applies a route prefix and shared safe defaults.
Implementations§
Source§impl EndpointGroup
impl EndpointGroup
Sourcepub fn new(prefix: RoutePath) -> Self
pub fn new(prefix: RoutePath) -> Self
Creates a public endpoint group under one portable prefix.
Sets the authorization inherited by new endpoints.
Sourcepub fn rate_limit(self, policy: RateLimitPolicy) -> Self
pub fn rate_limit(self, policy: RateLimitPolicy) -> Self
Sets the rate limit inherited by new endpoints.
Sourcepub fn timeout(self, timeout: Duration) -> SoapResult<Self>
pub fn timeout(self, timeout: Duration) -> SoapResult<Self>
Sets the timeout inherited by new endpoints.
Sourcepub fn body_limit(self, policy: BodyLimitPolicy) -> Self
pub fn body_limit(self, policy: BodyLimitPolicy) -> Self
Sets the encoded body limit inherited by new endpoints.
Sourcepub fn cors(self, policy: CorsPolicy) -> Self
pub fn cors(self, policy: CorsPolicy) -> Self
Sets the cross-origin policy inherited by new endpoints.
Sourcepub const fn require_csrf(self) -> Self
pub const fn require_csrf(self) -> Self
Requires CSRF validation for new endpoints.
Sourcepub fn security_headers(self, policy: SecurityHeadersPolicy) -> Self
pub fn security_headers(self, policy: SecurityHeadersPolicy) -> Self
Replaces security-header defaults inherited by new endpoints.
Sourcepub fn without_security_headers(self) -> Self
pub fn without_security_headers(self) -> Self
Explicitly delegates security headers for new endpoints to the application.
Sourcepub fn response_cache(self, policy: ResponseCachePolicy) -> SoapResult<Self>
pub fn response_cache(self, policy: ResponseCachePolicy) -> SoapResult<Self>
Sets the response-cache policy inherited by new endpoints.
Sourcepub fn telemetry(self, policy: TelemetryPolicy) -> SoapResult<Self>
pub fn telemetry(self, policy: TelemetryPolicy) -> SoapResult<Self>
Replaces telemetry instructions inherited by new endpoints.
Sourcepub fn tag(self, tag: impl Into<String>) -> SoapResult<Self>
pub fn tag(self, tag: impl Into<String>) -> SoapResult<Self>
Adds one documentation tag inherited by new endpoints.
Sourcepub fn endpoint(
&self,
id: impl Into<String>,
method: Method,
path: RoutePath,
) -> SoapResult<EndpointMetadata>
pub fn endpoint( &self, id: impl Into<String>, method: Method, path: RoutePath, ) -> SoapResult<EndpointMetadata>
Creates a new endpoint with the group prefix and policies applied.
Trait Implementations§
Source§impl Clone for EndpointGroup
impl Clone for EndpointGroup
Source§fn clone(&self) -> EndpointGroup
fn clone(&self) -> EndpointGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more