pub struct RustApiConfig { /* private fields */ }Expand description
Configuration builder for RustAPI with auto-routes
Implementations§
Source§impl RustApiConfig
impl RustApiConfig
pub fn new() -> Self
Sourcepub fn docs_enabled(self, enabled: bool) -> Self
pub fn docs_enabled(self, enabled: bool) -> Self
Enable or disable docs (default: true)
Sourcepub fn openapi_info(
self,
title: impl Into<String>,
version: impl Into<String>,
description: Option<impl Into<String>>,
) -> Self
pub fn openapi_info( self, title: impl Into<String>, version: impl Into<String>, description: Option<impl Into<String>>, ) -> Self
Set OpenAPI info
Sourcepub fn body_limit(self, limit: usize) -> Self
pub fn body_limit(self, limit: usize) -> Self
Set body size limit
Sourcepub fn layer<L>(self, layer: L) -> Selfwhere
L: MiddlewareLayer,
pub fn layer<L>(self, layer: L) -> Selfwhere
L: MiddlewareLayer,
Add a middleware layer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustApiConfig
impl !RefUnwindSafe for RustApiConfig
impl Send for RustApiConfig
impl Sync for RustApiConfig
impl Unpin for RustApiConfig
impl !UnwindSafe for RustApiConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more