openthread::ot

Trait Dnssd

Source
pub trait Dnssd {
    // Required methods
    fn dnssd_get_next_query(
        &self,
        prev: Option<&DnssdQuery>,
    ) -> Option<&DnssdQuery>;
    fn dnssd_query_handle_discovered_host(
        &self,
        hostname: &CStr,
        addresses: &[Ip6Address],
        ttl: u32,
    );
    fn dnssd_query_handle_discovered_service_instance(
        &self,
        service_full_name: &CStr,
        addresses: &[Ip6Address],
        full_name: &CStr,
        host_name: &CStr,
        port: u16,
        priority: u16,
        ttl: u32,
        txt_data: &[u8],
        weight: u16,
    );
    fn dnssd_query_set_callbacks<'a, F>(&'a self, f: Option<F>)
       where F: FnMut(bool, &CStr) + 'a;
    fn dnssd_get_counters(&self) -> &DnssdCounters;
    fn dnssd_upstream_query_is_enabled(&self) -> bool;
    fn dnssd_upstream_query_set_enabled(&self, enabled: bool);
}
Expand description

Required Methods§

Source

fn dnssd_get_next_query(&self, prev: Option<&DnssdQuery>) -> Option<&DnssdQuery>

Functional equivalent to otDnssdGetNextQuery.

Arguments:

  • prev: Reference to the previous DnssdQuery, or None to get the first DnssdQuery.
Source

fn dnssd_query_handle_discovered_host( &self, hostname: &CStr, addresses: &[Ip6Address], ttl: u32, )

Functional equivalent to otDnssdQueryHandleDiscoveredHost.

Source

fn dnssd_query_handle_discovered_service_instance( &self, service_full_name: &CStr, addresses: &[Ip6Address], full_name: &CStr, host_name: &CStr, port: u16, priority: u16, ttl: u32, txt_data: &[u8], weight: u16, )

Functional equivalent to otDnssdQueryHandleDiscoveredServiceInstance.

Arguments:

  • service_full_name: Full service name (e.g._ipps._tcp.default.service.arpa.) Must end with ..
  • addresses: Reference to array of addresses for service.
  • full_name: Full instance name (e.g.OpenThread._ipps._tcp.default.service.arpa.). Must end with ..
  • host_name: Host name (e.g. ot-host.default.service.arpa.). Must end with ..
  • port: Service port.
  • priority: Service priority.
  • ttl: Service TTL (in seconds).
  • txt_data: Array of bytes representing the TXT record.
  • weight: Service weight.
Source

fn dnssd_query_set_callbacks<'a, F>(&'a self, f: Option<F>)
where F: FnMut(bool, &CStr) + 'a,

Functional equivalent of otsys::otDnssdQuerySetCallbacks.

The callback closure takes two arguments:

  • bool: True if subscribing, false if unsubscribing.
  • &CStr: Full name.
Source

fn dnssd_get_counters(&self) -> &DnssdCounters

Functional equivalent of otsys::otDnssdGetCounters.

Source

fn dnssd_upstream_query_is_enabled(&self) -> bool

Functional equivalent of otsys::otDnssdUpstreamQueryIsEnabled

Source

fn dnssd_upstream_query_set_enabled(&self, enabled: bool)

Functional equivalent of otsys::otDnssdUpstreamQuerySetEnabled

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§