Skip to main content

UnixUpstreamFactory

Trait UnixUpstreamFactory 

Source
pub trait UnixUpstreamFactory:
    Send
    + Sync
    + 'static {
    // Required method
    fn connect(
        &self,
        path: PathBuf,
    ) -> Arc<dyn StreamUpstream<Conn = Box<dyn StreamConnection>>> ⓘ;
}
Expand description

Runtime-agnostic factory that builds a StreamUpstream dialing a Unix-domain socket path — the Unix sibling of AcceptorFactory, for the dispatch sites (StreamPassthroughUpstream) that pick a backend by transport name rather than binding a listener.

Conn is pinned to Box<dyn StreamConnection> so the trait stays object-safe and one backend’s upstream (prime’s PrimeUnixConnection, tokio’s TokioUnixConnection) can sit behind the same Arc<dyn UnixUpstreamFactory> field as the other — the same erasure boundary Box<dyn StreamConnection>’s own StreamConnection impl above already established, one level up.

connect is cheap and synchronous, mirroring StreamUpstream itself: building the upstream value never touches the network — the actual dial happens lazily when the returned value’s connection future is polled.

Required Methods§

Source

fn connect( &self, path: PathBuf, ) -> Arc<dyn StreamUpstream<Conn = Box<dyn StreamConnection>>> ⓘ

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§