pub struct RouteHandle {
pub channel: u16,
pub epoch: u32,
/* private fields */
}Expand description
Immutable identity of one route binding on one live connection.
Only channel and epoch are serialized. The private connection token prevents
work retained from an earlier connection from acting on a later connection that
happens to reuse the same wire pair.
Fields§
§channel: u16§epoch: u32Implementations§
Source§impl RouteHandle
impl RouteHandle
Sourcepub fn detached(channel: u16, epoch: u32) -> Self
pub fn detached(channel: u16, epoch: u32) -> Self
A handle for channel and epoch that belongs to no connection, for
building values in tests, such as a RouteBindRequest passed to a
module’s own on_bind. It is never bound to a connection and cannot
become one.
Every operation that would reach a connection fails with the error
it returns for a closed or stale route, and sends nothing:
ModuleHandle::push returns SubcModuleError::StaleRouteHandle;
SubcConsumer::request, SubcConsumer::subscribe_route,
SubcConsumer::poll_route, SubcConsumer::push_events and
SubcConsumer::close_handle return CallError::StaleRouteHandle;
Self::on_request and Self::on_request_fallible return
ReverseRequestRegistrationError::NotConsumerRoute.