Trait zeroconf::service::TMdnsService[][src]

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

Creates a new MdnsService with the specified ServiceType (e.g. _http._tcp) and port.

Sets the name to register this service under.

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.

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.

Sets the optional TxtRecord to register this service with.

Sets the ServiceRegisteredCallback that is invoked when the service has been registered.

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.

Registers and start’s the service. Returns an EventLoop which can be called to keep the service alive.

Implementors