1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-18 13:01:49 +01:00
This commit is contained in:
Rob Ede 2021-10-28 20:59:44 +01:00
parent 75a877b631
commit e49fedbfe7
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933

View File

@ -1,5 +1,4 @@
use std::sync::mpsc;
use std::{fmt, net, thread};
use std::{fmt, net, sync::mpsc, thread};
use actix_rt::{net::TcpStream, System};
use actix_service::ServiceFactory;
@ -28,9 +27,10 @@ use crate::{Server, ServerBuilder};
/// println!("SOCKET: {:?}", srv.connect());
/// }
/// ```
#[non_exhaustive]
pub struct TestServer;
/// Test server runtime
/// Test server runtime.
pub struct TestServerRuntime {
addr: net::SocketAddr,
host: String,
@ -39,7 +39,7 @@ pub struct TestServerRuntime {
}
impl TestServer {
/// Start new server with server builder.
/// Start new server using server builder.
pub fn start<F>(mut factory: F) -> TestServerRuntime
where
F: FnMut(ServerBuilder) -> ServerBuilder + Send + 'static,
@ -64,7 +64,7 @@ impl TestServer {
}
}
/// Start new test server with application factory.
/// Start new test server with default settings using application factory.
pub fn with<F, InitErr>(factory: F) -> TestServerRuntime
where
F: ServiceFactory<TcpStream, Config = (), InitError = InitErr> + Send + Clone + 'static,