Struct cargo_test_support::registry::HttpServer
source · pub struct HttpServer {
listener: TcpListener,
registry_path: PathBuf,
dl_path: PathBuf,
addr: SocketAddr,
token: Token,
auth_required: bool,
custom_responders: HashMap<&'static str, Box<dyn Send + Fn(&Request, &HttpServer) -> Response>>,
}
Fields§
§listener: TcpListener
§registry_path: PathBuf
§dl_path: PathBuf
§addr: SocketAddr
§token: Token
§auth_required: bool
§custom_responders: HashMap<&'static str, Box<dyn Send + Fn(&Request, &HttpServer) -> Response>>
Implementations§
source§impl HttpServer
impl HttpServer
pub fn new(
registry_path: PathBuf,
dl_path: PathBuf,
token: Token,
auth_required: bool,
api_responders: HashMap<&'static str, Box<dyn Send + Fn(&Request, &HttpServer) -> Response>>
) -> HttpServerHandle
fn start(&self)
Unauthorized response
sourcepub fn internal_server_error(&self, _req: &Request) -> Response
pub fn internal_server_error(&self, _req: &Request) -> Response
Return an internal server error (HTTP 500)
Auto Trait Implementations§
impl !RefUnwindSafe for HttpServer
impl Send for HttpServer
impl !Sync for HttpServer
impl Unpin for HttpServer
impl !UnwindSafe for HttpServer
Blanket Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 184 bytes