pub struct ServerBuilder { /* private fields */ }
Expand description
Builder for server configuration
Implementations§
Source§impl ServerBuilder
impl ServerBuilder
pub fn new() -> Self
pub fn with_server_info(self, info: ServerInfo) -> Self
pub fn with_port(self, port: u16) -> Self
pub fn with_transport(self, transport: TransportType) -> Self
pub fn with_cors_policy(self, cors: CorsPolicy) -> Self
pub fn with_middleware(self, middleware: MiddlewareConfig) -> Self
pub fn with_metrics_endpoint(self, path: impl Into<String>) -> Self
pub fn with_health_endpoint(self, path: impl Into<String>) -> Self
pub fn with_custom_endpoint( self, path: impl Into<String>, method: impl Into<String>, handler_name: impl Into<String>, ) -> Self
pub fn with_connection_timeout(self, timeout: Duration) -> Self
pub fn with_max_connections(self, max: usize) -> Self
pub fn with_compression(self, enable: bool) -> Self
pub fn with_tls( self, cert_path: impl Into<String>, key_path: impl Into<String>, ) -> Self
pub fn build(self) -> Result<BuiltServerConfig, CliError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServerBuilder
impl RefUnwindSafe for ServerBuilder
impl Send for ServerBuilder
impl Sync for ServerBuilder
impl Unpin for ServerBuilder
impl UnwindSafe for ServerBuilder
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