[][src]Struct lib3h_mdns::MulticastDns

pub struct MulticastDns { /* fields omitted */ }

an mdns instance that can send and receive dns packets on LAN UDP multicast

Methods

impl MulticastDns[src]

pub fn address(&self) -> &str[src]

IP address of the mDNS server.

pub fn port(&self) -> u16[src]

the mDNS service port on the machine.

pub fn multicast_loop(&self) -> bool[src]

Returns wether multicasting is set to loop or not.

pub fn multicast_ttl(&self) -> u32[src]

Returns the time to live value.

pub fn multicast_address(&self) -> &str[src]

Returns the multicast address used by mDNS

pub fn records(&self) -> &MapRecord[src]

Returns the lookup table of records as a HashMap.

pub fn own_urls(&self) -> Vec<String>[src]

Returns a vector of all the url we own through every NetworkId.

pub fn urls(&self) -> Vec<Lib3hUri>[src]

Returns all the urls for every NetworkId.

pub fn own_networkids(&self) -> Vec<&str>[src]

Returns all the NetworkIds we are currently in.

pub fn query_interval_ms(&self) -> u128[src]

Returns the amount of time we wait between two queries.

pub fn insert_own_record(&mut self, netid: &str, records: &[&str])[src]

Insert a new record to our cache.

pub fn insert_record(&mut self, netid: &str, records: &[&str])[src]

Insert a new record to our cache.

pub fn update_cache(&mut self, other_map_record: &MapRecord)[src]

Update our cache of resource records.

pub fn broadcast_message(
    &self,
    dmesg: &DnsMessage
) -> Result<usize, MulticastDnsError>
[src]

Broadcasts a DNS message.

pub fn broadcast(&self, data: &[u8]) -> Result<usize, MulticastDnsError>[src]

Broadcasts a packet.

pub fn recv(&mut self) -> MulticastDnsResult<Option<(Vec<u8>, SocketAddr)>>[src]

try to receive a dns packet. will return None rather than blocking if none are queued

pub fn clear_buffer(&mut self)[src]

Clean our buffer of bytes from previous messages.

pub fn prune_cache(&mut self)[src]

Clean our cache by removing the out of live records.

pub fn update_ttl(&mut self)[src]

Update the time to live of every cached record.

pub fn query(&mut self) -> MulticastDnsResult<()>[src]

mDNS Querier, implementing the "One-Shot Multicast DNS Queries" from the standard.

pub fn build_query_message(&self) -> Option<DnsMessage>[src]

Builds a query DNS message to be used by one-shot mDNS implementation.

Trait Implementations

impl Discovery for MulticastDns[src]

fn advertise(&mut self) -> DiscoveryResult<()>[src]

Make yourself known on the network.

fn discover(&mut self) -> DiscoveryResult<Vec<Lib3hUri>>[src]

Read the UDP stack and update our cache accordingly.

fn release(&mut self) -> DiscoveryResult<()>[src]

Release itself from the available participants in a network.

fn flush(&mut self) -> DiscoveryResult<()>[src]

Clear our cache from resource records.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,