pub struct ApiServerConfigBuilder { /* private fields */ }Expand description
Fluent builder for ApiServerConfig.
Obtain via ApiServerConfig::builder(). All fields start with the same
defaults as ApiServerConfig::default().
Implementations§
Source§impl ApiServerConfigBuilder
impl ApiServerConfigBuilder
Sourcepub fn host(self, host: impl Into<String>) -> Self
pub fn host(self, host: impl Into<String>) -> Self
Set the address to bind to (e.g. "0.0.0.0").
Sourcepub fn enable_cors(self, enable: bool) -> Self
pub fn enable_cors(self, enable: bool) -> Self
Enable or disable CORS (default: disabled).
Sourcepub fn allow_origin(self, origin: impl Into<String>) -> Self
pub fn allow_origin(self, origin: impl Into<String>) -> Self
Append a single allowed origin for CORS (e.g. "https://example.com").
Sourcepub fn allowed_origins(self, origins: Vec<String>) -> Self
pub fn allowed_origins(self, origins: Vec<String>) -> Self
Replace the allowed origins list for CORS.
Sourcepub fn max_body_size(self, size: usize) -> Self
pub fn max_body_size(self, size: usize) -> Self
Set the maximum request body size in bytes (default: 1 MB).
Sourcepub fn enable_tracing(self, enable: bool) -> Self
pub fn enable_tracing(self, enable: bool) -> Self
Enable or disable structured request/response tracing (default: enabled).
Sourcepub fn build(self) -> ApiServerConfig
pub fn build(self) -> ApiServerConfig
Consume the builder and return the finished ApiServerConfig.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiServerConfigBuilder
impl RefUnwindSafe for ApiServerConfigBuilder
impl Send for ApiServerConfigBuilder
impl Sync for ApiServerConfigBuilder
impl Unpin for ApiServerConfigBuilder
impl UnsafeUnpin for ApiServerConfigBuilder
impl UnwindSafe for ApiServerConfigBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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