pub struct Host<'a> {
pub hostname: &'a str,
pub ipv4: Ipv4Addr,
pub ipv6: Ipv6Addr,
pub ttl: Ttl,
}Expand description
A simple representation of a host that can be used to generate mDNS answers.
This structure implements the HostAnswers trait, which allows it to be used
as a responder for mDNS queries coming from other network peers.
Fields§
§hostname: &'a strThe name of the host. I.e. a name “foo” will be pingable as “foo.local”
ipv4: Ipv4AddrThe IPv4 address of the host.
Leaving it as Ipv4Addr::UNSPECIFIED means that the host will not aswer it to A queries.
ipv6: Ipv6AddrThe IPv6 address of the host.
Leaving it as Ipv6Addr::UNSPECIFIED means that the host will not aswer it to AAAA queries.
ttl: TtlThe time-to-live of the mDNS answers.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Host<'a>
impl<'a> RefUnwindSafe for Host<'a>
impl<'a> Send for Host<'a>
impl<'a> Sync for Host<'a>
impl<'a> Unpin for Host<'a>
impl<'a> UnsafeUnpin for Host<'a>
impl<'a> UnwindSafe for Host<'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.