#[non_exhaustive]pub enum ServiceEvent<'a> {
Question(ServiceQuestion<'a>),
ProbeConflict(ProbeConflict<'a>),
HostConflict(HostConflict<'a>),
KnownAnswer(KnownAnswer<'a>),
}Expand description
Events delivered from Endpoint::handle() to a Service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Question(ServiceQuestion<'a>)
A question targeting this service arrived.
ProbeConflict(ProbeConflict<'a>)
While probing, another peer responded authoritatively for our instance name. The service will auto-rename.
HostConflict(HostConflict<'a>)
While probing, another peer responded authoritatively for our host name
(A/AAAA owner). The service will NOT auto-rename — the caller must
intervene. See ServiceUpdate::HostConflict.
KnownAnswer(KnownAnswer<'a>)
A known-answer hint from an incoming query — caller may use it for KAS-style suppression of outgoing answers.
Implementations§
Source§impl<'a> ServiceEvent<'a>
impl<'a> ServiceEvent<'a>
Sourcepub const fn is_question(&self) -> bool
pub const fn is_question(&self) -> bool
Returns true if this value is of type Question. Returns false otherwise
Sourcepub const fn is_probe_conflict(&self) -> bool
pub const fn is_probe_conflict(&self) -> bool
Returns true if this value is of type ProbeConflict. Returns false otherwise
Sourcepub const fn is_host_conflict(&self) -> bool
pub const fn is_host_conflict(&self) -> bool
Returns true if this value is of type HostConflict. Returns false otherwise
Sourcepub const fn is_known_answer(&self) -> bool
pub const fn is_known_answer(&self) -> bool
Returns true if this value is of type KnownAnswer. Returns false otherwise
Source§impl<'a> ServiceEvent<'a>
impl<'a> ServiceEvent<'a>
Sourcepub fn unwrap_question(self) -> ServiceQuestion<'a>
pub fn unwrap_question(self) -> ServiceQuestion<'a>
Unwraps this value to the ServiceEvent::Question variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_question_ref(&self) -> &ServiceQuestion<'a>
pub fn unwrap_question_ref(&self) -> &ServiceQuestion<'a>
Unwraps this reference to the ServiceEvent::Question variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_probe_conflict(self) -> ProbeConflict<'a>
pub fn unwrap_probe_conflict(self) -> ProbeConflict<'a>
Unwraps this value to the ServiceEvent::ProbeConflict variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_probe_conflict_ref(&self) -> &ProbeConflict<'a>
pub fn unwrap_probe_conflict_ref(&self) -> &ProbeConflict<'a>
Unwraps this reference to the ServiceEvent::ProbeConflict variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_host_conflict(self) -> HostConflict<'a>
pub fn unwrap_host_conflict(self) -> HostConflict<'a>
Unwraps this value to the ServiceEvent::HostConflict variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_host_conflict_ref(&self) -> &HostConflict<'a>
pub fn unwrap_host_conflict_ref(&self) -> &HostConflict<'a>
Unwraps this reference to the ServiceEvent::HostConflict variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_known_answer(self) -> KnownAnswer<'a>
pub fn unwrap_known_answer(self) -> KnownAnswer<'a>
Unwraps this value to the ServiceEvent::KnownAnswer variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_known_answer_ref(&self) -> &KnownAnswer<'a>
pub fn unwrap_known_answer_ref(&self) -> &KnownAnswer<'a>
Unwraps this reference to the ServiceEvent::KnownAnswer variant.
Panics if this value is of any other type.
Source§impl<'a> ServiceEvent<'a>
impl<'a> ServiceEvent<'a>
Sourcepub fn try_unwrap_question(
self,
) -> Result<ServiceQuestion<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_question( self, ) -> Result<ServiceQuestion<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the ServiceEvent::Question variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_question_ref(
&self,
) -> Result<&ServiceQuestion<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_question_ref( &self, ) -> Result<&ServiceQuestion<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ServiceEvent::Question variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_probe_conflict(
self,
) -> Result<ProbeConflict<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_probe_conflict( self, ) -> Result<ProbeConflict<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the ServiceEvent::ProbeConflict variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_probe_conflict_ref(
&self,
) -> Result<&ProbeConflict<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_probe_conflict_ref( &self, ) -> Result<&ProbeConflict<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ServiceEvent::ProbeConflict variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_host_conflict(
self,
) -> Result<HostConflict<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_host_conflict( self, ) -> Result<HostConflict<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the ServiceEvent::HostConflict variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_host_conflict_ref(
&self,
) -> Result<&HostConflict<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_host_conflict_ref( &self, ) -> Result<&HostConflict<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ServiceEvent::HostConflict variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_known_answer(
self,
) -> Result<KnownAnswer<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_known_answer( self, ) -> Result<KnownAnswer<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the ServiceEvent::KnownAnswer variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_known_answer_ref(
&self,
) -> Result<&KnownAnswer<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_known_answer_ref( &self, ) -> Result<&KnownAnswer<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ServiceEvent::KnownAnswer variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl<'a> Clone for ServiceEvent<'a>
impl<'a> Clone for ServiceEvent<'a>
Source§fn clone(&self) -> ServiceEvent<'a>
fn clone(&self) -> ServiceEvent<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more