Skip to main content

LocalService

Trait LocalService 

Source
pub trait LocalService: Sync {
    // Required methods
    fn prefix(&self) -> &[u8] ⓘ;
    fn serve(&self, client: &TcpStream);
}
Expand description

A service that shares the proxy’s port.

Required Methods§

Source

fn prefix(&self) -> &[u8] ⓘ

The bytes a connection for this service starts with. Not empty, and not the start of any HTTP method.

Source

fn serve(&self, client: &TcpStream)

Serve one connection. Its first bytes are Self::prefix, still unread. The service records what it decides itself.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§