Skip to main content

Module testing

Module testing 

Source

Re-exports§

pub use crate::Protocol;
pub use crate::ProxySession;
pub use crate::backends::BackendMap;
pub use crate::http::HttpProxy;
pub use crate::https::HttpsProxy;
pub use crate::pool::Pool;
pub use crate::server::ListenSession;
pub use crate::server::ProxyChannel;
pub use crate::server::Server;
pub use crate::server::SessionManager;
pub use crate::tcp::TcpProxy;

Structs§

HttpListenerConfig
details of an HTTP listener
HttpsListenerConfig
details of an HTTPS listener
Listeners
Listener keys (socket address, plus interface when bound) and file descriptors of listening sockets, needed by a Proxy to start listening. The transport is fd-type-agnostic: udp carries UdpSocket fds, the others carry TcpListener fds.
Poll
Polls for readiness events on all registered values.
Rc
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
RefCell
A mutable memory location with dynamically checked borrow rules
Registry
Registers I/O resources.
ScmSocket
A unix socket specialized for file descriptor passing
ServerConfig
Used by a worker to start its server loop. The defaults should match those of the config module
ServerParts
Everything needed to create a Server
Slab
Pre-allocated storage for a uniform data type
TcpListenerConfig
details of an TCP listener
Token
Associates readiness events with event::Sources.
UnixStream
A non-blocking Unix stream socket.

Traits§

Context
Provides the context method for Result.
IntoRawFd
A trait to express the ability to consume an object and acquire ownership of its raw file descriptor.

Functions§

prebuild_server
Setup a standalone server, for testing purposes
provide_port
Get a localhost port for a test listener, held by reserve_port: unique across concurrent processes that all allocate their ports through reserve_port, within that function’s limits.
reserve_port
Reserve 127.0.0.1:port against the other processes on this machine that also reserve their ports through this function, until this process has reserved 256 more ports. Returns false, reserving nothing, when the port is already in use.