#[non_exhaustive]pub struct BackendServerConfig {
pub host: Option<String>,
pub port: Option<(u16, u16)>,
pub admin_name: Option<Arc<str>>,
pub tango_host: Option<(Arc<str>, u16)>,
pub zmq_heartbeat_port: Option<(u16, u16)>,
pub zmq_event_port: Option<(u16, u16)>,
}Expand description
How a backend serves, see Backend::serve, whatever is not given being left to the
backend, which is what the default configuration is.
A range of ports is given by both its ends, which are included, so that it holds at least one port. A range including port 0 is the system picking any port, whatever the other end, the same as giving none.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.host: Option<String>The host to listen at, an address or a name of this machine, every one of its interfaces if none is given.
port: Option<(u16, u16)>The port (or range of ports) to listen at, one the system picks if none is given, which is what a Tango device server does: its clients find it through the database, where it is exported. A fixed port is what a server without a database needs, its clients having nothing else to find it by. The port range has both ends inclusive.
admin_name: Option<Arc<str>>The name of the admin device of the server being served, dserver/exe/inst, which
names the event channel of the server: a backend not given one publishes no event.
tango_host: Option<(Arc<str>, u16)>The host and port of the database the server is registered in, which prefixes the names of its events. A server without a database prefixes them with its own host and port instead, marking them as such.
zmq_heartbeat_port: Option<(u16, u16)>The port (or range of ports) the ZMQ backend may use for its heartbeat PUB socket. This should be ignored by backends without ZMQ. The port range has both ends inclusive.
zmq_event_port: Option<(u16, u16)>The port (or range of ports) the ZMQ backend may use for its event PUB socket. This should be ignored by backends without ZMQ. The port range has both ends inclusive.
Implementations§
Source§impl BackendServerConfig
impl BackendServerConfig
Sourcepub fn host(self, host: &str) -> Self
pub fn host(self, host: &str) -> Self
Listen at that host, see Self::host.
Sourcepub fn port<R: RangeBounds<u16>>(self, port: R) -> Self
pub fn port<R: RangeBounds<u16>>(self, port: R) -> Self
Listen at that port, see Self::port.
Sourcepub fn admin_name(self, admin_name: impl Into<Arc<str>>) -> Self
pub fn admin_name(self, admin_name: impl Into<Arc<str>>) -> Self
Serve the server of that admin device, see Self::admin_name.
Sourcepub fn tango_host(self, host: impl Into<Arc<str>>, port: u16) -> Self
pub fn tango_host(self, host: impl Into<Arc<str>>, port: u16) -> Self
Serve a server registered in the database at that host and port, see
Self::tango_host.
Sourcepub fn zmq_heartbeat_port<R: RangeBounds<u16>>(self, port: R) -> Self
pub fn zmq_heartbeat_port<R: RangeBounds<u16>>(self, port: R) -> Self
Make ZMQ listen at this port for its heartbeat, see Self::zmq_heartbeat_port.
Sourcepub fn zmq_event_port<R: RangeBounds<u16>>(self, port: R) -> Self
pub fn zmq_event_port<R: RangeBounds<u16>>(self, port: R) -> Self
Make ZMQ listen at this port for its events, see Self::zmq_event_port.