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
Methods from the OpenThread DNS-SD Server Module.
Required Methods§
Sourcefn dnssd_get_next_query(&self, prev: Option<&DnssdQuery>) -> Option<&DnssdQuery>
fn dnssd_get_next_query(&self, prev: Option<&DnssdQuery>) -> Option<&DnssdQuery>
Functional equivalent to otDnssdGetNextQuery
.
Arguments:
prev
: Reference to the previousDnssdQuery
, orNone
to get the first DnssdQuery.
Sourcefn dnssd_query_handle_discovered_host(
&self,
hostname: &CStr,
addresses: &[Ip6Address],
ttl: u32,
)
fn dnssd_query_handle_discovered_host( &self, hostname: &CStr, addresses: &[Ip6Address], ttl: u32, )
Functional equivalent to otDnssdQueryHandleDiscoveredHost
.
Sourcefn 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_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.
Sourcefn dnssd_query_set_callbacks<'a, F>(&'a self, f: Option<F>)
fn dnssd_query_set_callbacks<'a, F>(&'a self, f: Option<F>)
Functional equivalent of
otsys::otDnssdQuerySetCallbacks
.
The callback closure takes two arguments:
- bool: True if subscribing, false if unsubscribing.
- &CStr: Full name.
Sourcefn dnssd_get_counters(&self) -> &DnssdCounters
fn dnssd_get_counters(&self) -> &DnssdCounters
Functional equivalent of
otsys::otDnssdGetCounters
.
Sourcefn dnssd_upstream_query_is_enabled(&self) -> bool
fn dnssd_upstream_query_is_enabled(&self) -> bool
Functional equivalent of
otsys::otDnssdUpstreamQueryIsEnabled
Sourcefn dnssd_upstream_query_set_enabled(&self, enabled: bool)
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.