pub struct TestServerBuilder<Cfg, F, Sf, I> { /* private fields */ }Expand description
Builder for a single-worker test server.
The server listens on an ephemeral 127.0.0.1 port and runs in a separate
thread with its own runtime.
Implementations§
Source§impl<F, S, I> TestServerBuilder<NoConfig, F, S, I>
impl<F, S, I> TestServerBuilder<NoConfig, F, S, I>
Sourcepub fn new(factory: F) -> TestServerBuilder<NoConfig, F, S, I>
pub fn new(factory: F) -> TestServerBuilder<NoConfig, F, S, I>
Creates a test server builder for the specified service factory.
Source§impl<Cfg, F, S, I> TestServerBuilder<Cfg, F, S, I>where
F: AsyncFn() -> I + Send + Clone + 'static,
I: IntoService<S, <Cfg as ServerAppConfig>::State, Io> + 'static,
S: Service<<Cfg as ServerAppConfig>::State, Io> + 'static,
Cfg: ServerAppConfig + 'static,
impl<Cfg, F, S, I> TestServerBuilder<Cfg, F, S, I>where
F: AsyncFn() -> I + Send + Clone + 'static,
I: IntoService<S, <Cfg as ServerAppConfig>::State, Io> + 'static,
S: Service<<Cfg as ServerAppConfig>::State, Io> + 'static,
Cfg: ServerAppConfig + 'static,
Sourcepub fn with(cfg: Cfg, factory: F) -> TestServerBuilder<Cfg, F, S, I>
pub fn with(cfg: Cfg, factory: F) -> TestServerBuilder<Cfg, F, S, I>
Creates a test server builder with application configuration.
Sourcepub fn config<T>(self, cfg: T) -> TestServerBuilder<Cfg, F, S, I>
pub fn config<T>(self, cfg: T) -> TestServerBuilder<Cfg, F, S, I>
Sets the I/O configuration for accepted server connections.
Sourcepub fn client_config<T>(self, cfg: T) -> TestServerBuilder<Cfg, F, S, I>
pub fn client_config<T>(self, cfg: T) -> TestServerBuilder<Cfg, F, S, I>
Sets the I/O configuration used by TestServer::connect.
Sourcepub fn start(self) -> TestServer
pub fn start(self) -> TestServer
Starts the test server and returns its controller.
Trait Implementations§
Auto Trait Implementations§
impl<Cfg, F, Sf, I> !RefUnwindSafe for TestServerBuilder<Cfg, F, Sf, I>
impl<Cfg, F, Sf, I> !UnwindSafe for TestServerBuilder<Cfg, F, Sf, I>
impl<Cfg, F, Sf, I> Freeze for TestServerBuilder<Cfg, F, Sf, I>
impl<Cfg, F, Sf, I> Send for TestServerBuilder<Cfg, F, Sf, I>
impl<Cfg, F, Sf, I> Sync for TestServerBuilder<Cfg, F, Sf, I>
impl<Cfg, F, Sf, I> Unpin for TestServerBuilder<Cfg, F, Sf, I>
impl<Cfg, F, Sf, I> UnsafeUnpin for TestServerBuilder<Cfg, F, Sf, I>where
Cfg: UnsafeUnpin,
F: UnsafeUnpin,
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