#[non_exhaustive]pub enum RouteEvent<'a> {
ToService(ToService<'a>),
ToQuery(ToQuery<'a>),
CacheUpdated,
}Expand description
A routing decision yielded by Endpoint::handle().
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ToService(ToService<'a>)
Route the event to the matched service.
ToQuery(ToQuery<'a>)
Route the event to the matched query.
CacheUpdated
The endpoint cache observed new or refreshed records as a side effect of this datagram. Callers can use this as a hint to re-poll queries.
Implementations§
Source§impl<'a> RouteEvent<'a>
impl<'a> RouteEvent<'a>
Sourcepub const fn is_to_service(&self) -> bool
pub const fn is_to_service(&self) -> bool
Returns true if this value is of type ToService. Returns false otherwise
Sourcepub const fn is_to_query(&self) -> bool
pub const fn is_to_query(&self) -> bool
Returns true if this value is of type ToQuery. Returns false otherwise
Sourcepub const fn is_cache_updated(&self) -> bool
pub const fn is_cache_updated(&self) -> bool
Returns true if this value is of type CacheUpdated. Returns false otherwise
Source§impl<'a> RouteEvent<'a>
impl<'a> RouteEvent<'a>
Sourcepub fn unwrap_to_service(self) -> ToService<'a>
pub fn unwrap_to_service(self) -> ToService<'a>
Unwraps this value to the RouteEvent::ToService variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_to_service_ref(&self) -> &ToService<'a>
pub fn unwrap_to_service_ref(&self) -> &ToService<'a>
Unwraps this reference to the RouteEvent::ToService variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_to_query(self) -> ToQuery<'a>
pub fn unwrap_to_query(self) -> ToQuery<'a>
Unwraps this value to the RouteEvent::ToQuery variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_to_query_ref(&self) -> &ToQuery<'a>
pub fn unwrap_to_query_ref(&self) -> &ToQuery<'a>
Unwraps this reference to the RouteEvent::ToQuery variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_cache_updated(self)
pub fn unwrap_cache_updated(self)
Unwraps this value to the RouteEvent::CacheUpdated variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_cache_updated_ref(&self)
pub fn unwrap_cache_updated_ref(&self)
Unwraps this reference to the RouteEvent::CacheUpdated variant.
Panics if this value is of any other type.
Source§impl<'a> RouteEvent<'a>
impl<'a> RouteEvent<'a>
Sourcepub fn try_unwrap_to_service(
self,
) -> Result<ToService<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_to_service( self, ) -> Result<ToService<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the RouteEvent::ToService variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_to_service_ref(
&self,
) -> Result<&ToService<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_to_service_ref( &self, ) -> Result<&ToService<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the RouteEvent::ToService variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_to_query(self) -> Result<ToQuery<'a>, TryUnwrapError<Self>>
pub fn try_unwrap_to_query(self) -> Result<ToQuery<'a>, TryUnwrapError<Self>>
Attempts to unwrap this value to the RouteEvent::ToQuery variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_to_query_ref(
&self,
) -> Result<&ToQuery<'a>, TryUnwrapError<&Self>>
pub fn try_unwrap_to_query_ref( &self, ) -> Result<&ToQuery<'a>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the RouteEvent::ToQuery variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_cache_updated(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_cache_updated(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the RouteEvent::CacheUpdated variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_cache_updated_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_cache_updated_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the RouteEvent::CacheUpdated variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl<'a> Clone for RouteEvent<'a>
impl<'a> Clone for RouteEvent<'a>
Source§fn clone(&self) -> RouteEvent<'a>
fn clone(&self) -> RouteEvent<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more