pub struct TcpListener { /* private fields */ }Implementations§
Source§impl TcpListener
impl TcpListener
Sourcepub fn key(&self) -> ListenerKey
pub fn key(&self) -> ListenerKey
This listener’s identity: its address, plus the network interface its socket is bound to when it has one.
Sourcepub fn is(&self, key: &ListenerKey) -> bool
pub fn is(&self, key: &ListenerKey) -> bool
Whether this listener is the one key names.
Sourcepub fn validate_config(_config: &TcpListenerConfig) -> Result<(), ListenerError>
pub fn validate_config(_config: &TcpListenerConfig) -> Result<(), ListenerError>
Validate that a worker can build this TCP listener configuration WITHOUT
constructing the full listener or binding a socket. TCP listener
construction has no fallible config today (no rustls context, no answer
templates; a bad bind surfaces later as an ActivateListener failure),
so this currently always succeeds. It exists for surface parity with the
HTTP/HTTPS validators the main process calls before committing an
Add*Listener to ConfigState and fanning it out (sozu#1301), and is
the hook for any future TCP-config validation.
pub fn activate( &mut self, registry: &Registry, tcp_listener: Option<MioTcpListener>, ) -> Result<Token, ProxyError>
Sourcepub fn update_config(
&mut self,
patch: &UpdateTcpListenerConfig,
) -> Result<(), ListenerError>
pub fn update_config( &mut self, patch: &UpdateTcpListenerConfig, ) -> Result<(), ListenerError>
Apply a partial-update patch to this TCP listener’s live configuration.
Fields absent in the patch (i.e. None) are preserved unchanged.