Trait zeroconf::service::TMdnsService
source · [−]pub trait TMdnsService {
fn new(service_type: ServiceType, port: u16) -> Self;
fn set_name(&mut self, name: &str);
fn set_network_interface(&mut self, interface: NetworkInterface);
fn set_domain(&mut self, _domain: &str);
fn set_host(&mut self, _host: &str);
fn set_txt_record(&mut self, txt_record: TxtRecord);
fn set_registered_callback(
&mut self,
registered_callback: Box<ServiceRegisteredCallback>
);
fn set_context(&mut self, context: Box<dyn Any>);
fn register(&mut self) -> Result<EventLoop<'_>>;
}Expand description
Interface for interacting with underlying mDNS service implementation registration capabilities.
Required Methods
fn new(service_type: ServiceType, port: u16) -> Self
fn new(service_type: ServiceType, port: u16) -> Self
Creates a new MdnsService with the specified ServiceType (e.g. _http._tcp) and port.
fn set_network_interface(&mut self, interface: NetworkInterface)
fn set_network_interface(&mut self, interface: NetworkInterface)
Sets the network interface to bind this service to.
Most applications will want to use the default value NetworkInterface::Unspec to bind to
all available interfaces.
fn set_domain(&mut self, _domain: &str)
fn set_domain(&mut self, _domain: &str)
Sets the domain on which to advertise the service.
Most applications will want to use the default value of ptr::null() to register to the
default domain.
Sets the SRV target host name.
Most applications will want to use the default value of ptr::null() to use the machine’s
default host name.
fn set_txt_record(&mut self, txt_record: TxtRecord)
fn set_txt_record(&mut self, txt_record: TxtRecord)
Sets the optional TxtRecord to register this service with.
fn set_registered_callback(
&mut self,
registered_callback: Box<ServiceRegisteredCallback>
)
fn set_registered_callback(
&mut self,
registered_callback: Box<ServiceRegisteredCallback>
)
Sets the ServiceRegisteredCallback that is invoked when the service has been
registered.
fn set_context(&mut self, context: Box<dyn Any>)
fn set_context(&mut self, context: Box<dyn Any>)
Sets the optional user context to pass through to the callback. This is useful if you need
to share state between pre and post-callback. The context type must implement Any.