pub struct StreamRegistry { /* private fields */ }Expand description
Registry for L4 stream services
Maps listen ports to services for both TCP and UDP protocols.
Implementations§
Source§impl StreamRegistry
impl StreamRegistry
Sourcepub fn register_tcp(&self, port: u16, service: StreamService)
pub fn register_tcp(&self, port: u16, service: StreamService)
Register a TCP service for a port
Sourcepub fn register_udp(&self, port: u16, service: StreamService)
pub fn register_udp(&self, port: u16, service: StreamService)
Register a UDP service for a port
Sourcepub fn resolve_tcp(&self, port: u16) -> Option<StreamService>
pub fn resolve_tcp(&self, port: u16) -> Option<StreamService>
Resolve TCP service for a port
Sourcepub fn resolve_udp(&self, port: u16) -> Option<StreamService>
pub fn resolve_udp(&self, port: u16) -> Option<StreamService>
Resolve UDP service for a port
Sourcepub fn update_tcp_backends(&self, port: u16, backends: Vec<SocketAddr>)
pub fn update_tcp_backends(&self, port: u16, backends: Vec<SocketAddr>)
Update backends for a TCP service
Sourcepub fn update_udp_backends(&self, port: u16, backends: Vec<SocketAddr>)
pub fn update_udp_backends(&self, port: u16, backends: Vec<SocketAddr>)
Update backends for a UDP service
Sourcepub fn unregister_tcp(&self, port: u16) -> Option<StreamService>
pub fn unregister_tcp(&self, port: u16) -> Option<StreamService>
Remove a TCP service
Sourcepub fn unregister_udp(&self, port: u16) -> Option<StreamService>
pub fn unregister_udp(&self, port: u16) -> Option<StreamService>
Remove a UDP service
Sourcepub fn list_tcp_services(&self) -> Vec<(u16, StreamService)>
pub fn list_tcp_services(&self) -> Vec<(u16, StreamService)>
List all registered TCP services with their listen ports.
Sourcepub fn list_udp_services(&self) -> Vec<(u16, StreamService)>
pub fn list_udp_services(&self) -> Vec<(u16, StreamService)>
List all registered UDP services with their listen ports.
Sourcepub fn spawn_health_checker(
self: &Arc<Self>,
interval: Duration,
timeout: Duration,
) -> JoinHandle<()>
pub fn spawn_health_checker( self: &Arc<Self>, interval: Duration, timeout: Duration, ) -> JoinHandle<()>
Spawn a background health checker that periodically probes all registered TCP backends with a connect-only health check.
UDP backends are not probed (there is no reliable connectionless
health check). They remain Unknown and are always considered usable.
The task runs every interval and uses timeout for each probe.
Returns a JoinHandle that can be used to cancel the checker.