pub struct MdnsService { /* private fields */ }Expand description
Long-running mDNS service with discovery, caching, and service registration.
Implementations§
Source§impl MdnsService
impl MdnsService
Sourcepub async fn new() -> Result<(Arc<Self>, UnboundedReceiver<MdnsEvent>)>
pub async fn new() -> Result<(Arc<Self>, UnboundedReceiver<MdnsEvent>)>
Create a new mDNS service. Returns the service handle and a receiver for events.
Sourcepub async fn add_query(&self, label: &str, qtype: u16, interval: Duration)
pub async fn add_query(&self, label: &str, qtype: u16, interval: Duration)
Add a periodic query. The query will be sent immediately, then every interval.
Sourcepub async fn remove_query(&self, label: &str)
pub async fn remove_query(&self, label: &str)
Remove a periodic query by label.
Sourcepub async fn register_service(&self, reg: ServiceRegistration)
pub async fn register_service(&self, reg: ServiceRegistration)
Register a local service to be advertised.
Sourcepub async fn unregister_service(&self, instance: &str, service_type: &str)
pub async fn unregister_service(&self, instance: &str, service_type: &str)
Unregister a local service. Sends a goodbye (TTL=0) for the service records.
Sourcepub async fn lookup(&self, name: &str, qtype: u16) -> Vec<RR>
pub async fn lookup(&self, name: &str, qtype: u16) -> Vec<RR>
Lookup cached records by name and type.
pub async fn active_lookup(&self, name: &str, qtype: u16)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MdnsService
impl !RefUnwindSafe for MdnsService
impl Send for MdnsService
impl Sync for MdnsService
impl Unpin for MdnsService
impl !UnwindSafe for MdnsService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more