pub struct TestServer { /* private fields */ }Expand description
Test server controller.
Dropping the last clone stops the server and its runtime, blocking the current thread for about 100 ms.
Implementations§
Source§impl TestServer
impl TestServer
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
Returns the server address.
Sourcepub fn set_addr(self, addr: SocketAddr) -> Self
pub fn set_addr(self, addr: SocketAddr) -> Self
Sets the address used by connect.
Sourcepub fn stop(&self)
pub fn stop(&self)
Requests a graceful server stop.
Returns without waiting for the stop to complete.
Sourcepub fn unused_addr() -> SocketAddr
pub fn unused_addr() -> SocketAddr
Returns a currently unused local address.
The port is released before this returns, so another process may take it first.
Trait Implementations§
Source§impl Clone for TestServer
impl Clone for TestServer
Source§fn clone(&self) -> TestServer
fn clone(&self) -> TestServer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TestServer
impl !Send for TestServer
impl !Sync for TestServer
impl !UnwindSafe for TestServer
impl Freeze for TestServer
impl Unpin for TestServer
impl UnsafeUnpin for TestServer
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