pub struct ServerBuilder {
pub listener: String,
pub addr: Option<SocketAddr>,
pub service_names: Vec<String>,
/* private fields */
}
Fields§
§listener: String
§addr: Option<SocketAddr>
§service_names: Vec<String>
Implementations§
source§impl ServerBuilder
impl ServerBuilder
pub fn new() -> Self
pub fn with_listener(self, listener: String) -> ServerBuilder
pub fn with_addr(self, addr: &'static str) -> ServerBuilder
pub fn with_service_names(self, service_names: Vec<String>) -> ServerBuilder
pub fn build(self) -> Self
pub fn add_service<S>(self, name: String, service: S) -> Selfwhere S: Service<Request<Body>, Response = Response<BoxBody>, Error = Infallible> + Clone + Send + 'static, S::Future: Send + 'static, S::Error: Into<Box<dyn Error + Send + Sync>> + Send + 'static,
pub async fn serve(self) -> Result<(), Box<dyn Error + Send + Sync>>
Trait Implementations§
source§impl Clone for ServerBuilder
impl Clone for ServerBuilder
source§fn clone(&self) -> ServerBuilder
fn clone(&self) -> ServerBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ServerBuilder
impl Debug for ServerBuilder
source§impl Default for ServerBuilder
impl Default for ServerBuilder
source§fn default() -> ServerBuilder
fn default() -> ServerBuilder
Returns the “default value” for a type. Read more