pub struct ServiceInfo { /* private fields */ }
Expand description

Complete info about a Service Instance.

We can construct some PTR, one SRV and one TXT record from this info, as well as A (IPv4 Address) records.

Implementations

Creates a new service info.

ty_domain is the service type and the domain label, for example “_my-service._udp.local.”.

my_name is the instance name, without the service type suffix. properties are optional key/value pairs for the service.

host_ipv4 can be one or more IPv4 addresses, in a type that implements AsIpv4Addrs trait. It supports:

  • Single IPv4: "192.168.0.1"
  • Multiple IPv4 separated by comma: "192.168.0.1,192.168.0.2"
  • A slice of IPv4: &["192.168.0.1", "192.168.0.2"]
  • All the above formats with Ipv4Addr or String instead of &str.

The host TTL and other TTL are set to default values.

Returns the service type including the domain label.

For example: “_my-service._udp.local.”.

Returns the service subtype including the domain label, if subtype has been defined.

For example: “_printer._sub._http._tcp.local.”.

Returns a reference of the service fullname.

This is useful, for example, in unregister.

Returns a reference of the properties from TXT records.

Returns the service’s hostname.

Returns the service’s port.

Returns the service’s addresses

Returns the service’s TTL used for SRV and Address records.

Returns the service’s TTL used for PTR and TXT records.

Returns the service’s priority used in SRV records.

Returns the service’s weight used in SRV records.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.