#[non_exhaustive]pub enum QueryEvent<'a> {
Answer(Ref<'a>),
Truncated,
}Expand description
Events delivered from Endpoint::handle() to a Query.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Answer(Ref<'a>)
A matching answer record arrived.
Truncated
Query received a truncated response (TC bit). Caller should hold off cancelling this query — more KAS suppression follows.
Implementations§
Source§impl<'a> QueryEvent<'a>
impl<'a> QueryEvent<'a>
Source§impl<'a> QueryEvent<'a>
impl<'a> QueryEvent<'a>
Sourcepub fn unwrap_answer(self) -> Ref<'a>
pub fn unwrap_answer(self) -> Ref<'a>
Unwraps this value to the QueryEvent::Answer variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_answer_ref(&self) -> &Ref<'a>
pub fn unwrap_answer_ref(&self) -> &Ref<'a>
Unwraps this reference to the QueryEvent::Answer variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_truncated(self)
pub fn unwrap_truncated(self)
Unwraps this value to the QueryEvent::Truncated variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_truncated_ref(&self)
pub fn unwrap_truncated_ref(&self)
Unwraps this reference to the QueryEvent::Truncated variant.
Panics if this value is of any other type.
Source§impl<'a> QueryEvent<'a>
impl<'a> QueryEvent<'a>
Sourcepub fn try_unwrap_answer(self) -> Result<Ref<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_answer(self) -> Result<Ref<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the QueryEvent::Answer variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_answer_ref(&self) -> Result<&Ref<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_answer_ref(&self) -> Result<&Ref<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the QueryEvent::Answer variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_truncated(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_truncated(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the QueryEvent::Truncated variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_truncated_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_truncated_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the QueryEvent::Truncated variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl<'a> Clone for QueryEvent<'a>
impl<'a> Clone for QueryEvent<'a>
Source§fn clone(&self) -> QueryEvent<'a>
fn clone(&self) -> QueryEvent<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more