DirectoryService

Trait DirectoryService 

Source
pub trait DirectoryService<N: Send + Sync, E: HandlerError>: Send + Sync {
    // Required method
    fn translate(&self, name: &N) -> Result<SocketAddr, Error<E>>;
}
Expand description

Netty-rs uses a pluggable directory service to translate from an id to an IP address and port number. This is provided via this trait. A SimpleDirectoryService struct is provided which translates from any type that implements ToSocketAddrs. This includes strings which are in the format of for example “127.0.0.1:8080”, which will allow consumers to easily use strings or IP addresses as identifiers. If a more complicated lookup is required then implementing this trait is always avaliable.

Required Methods§

Source

fn translate(&self, name: &N) -> Result<SocketAddr, Error<E>>

Translates names to Socket addresses

Implementors§