Module util

Source

Structs§

ServeHandle
A handle to a running Axum service.

Functions§

new_random_port
Returns a randomly selected port that is not in use.
new_random_socket_addr
Generates a SocketAddr on the IP 127.0.0.1, using a random port.
new_random_tcp_listener
Binds a std::net::TcpListener on the IP 127.0.0.1, using a random port.
new_random_tcp_listener_with_socket_addr
Binds a std::net::TcpListener on the IP 127.0.0.1, using a random port.
new_random_tokio_tcp_listener
Binds a tokio::net::TcpListener on the IP 127.0.0.1, using a random port.
new_random_tokio_tcp_listener_with_socket_addr
Binds a tokio::net::TcpListener on the IP 127.0.0.1, using a random port.
spawn_serve
A wrapper around axum::serve() for tests, which spawns the service in a new thread.