pub struct Service<'a> {
pub name: &'a str,
pub priority: u16,
pub weight: u16,
pub service: &'a str,
pub protocol: &'a str,
pub port: u16,
pub service_subtypes: &'a [&'a str],
pub txt_kvs: &'a [(&'a str, &'a str)],
}Expand description
A simple representation of a DNS-SD service that can be used to generate mDNS answers.
This structure (indirectly - via the ServiceAnswers wraper which also provides the hostname)
implements the HostAnswers trait, which allows it to be used as a responder for mDNS queries
coming from other network peers.
Fields§
§name: &'a strThe name of the service. I.e. “printer”
priority: u16The priority of the service.
weight: u16The weight of the service.
service: &'a strThe service type. I.e. “_http”
protocol: &'a strThe protocol of the service. I.e. “_tcp” or “_udp”
port: u16The TCP/UDP port where the service listens for incoming requests.
service_subtypes: &'a [&'a str]The subtypes of the service, if any.
txt_kvs: &'a [(&'a str, &'a str)]The key-value pairs that will be included in the TXT record, as per the DNS-SD spec.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Service<'a>
impl<'a> RefUnwindSafe for Service<'a>
impl<'a> Send for Service<'a>
impl<'a> Sync for Service<'a>
impl<'a> Unpin for Service<'a>
impl<'a> UnsafeUnpin for Service<'a>
impl<'a> UnwindSafe for Service<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.