pub struct Router<A: Address, Route: DeliveryRoute<Protocol: Protocol<Addr = A>> + Clone + PartialEq, R> { /* private fields */ }Expand description
A pure typed router over one concrete destination protocol.
State is the insertion-ordered recipient product plus a statically selected
policy. Inputs are RouterMessage; outputs are the concrete send product
selected by Route. Initialization is empty. Successful membership
transitions emit no effects. A successful route transfers ownership to one
selected member and continues; an empty selection returns RouterError
without changing membership. Fan-out is the distinct crate::Topic or
crate::PubSub law and therefore does not impose a message-cloning bound
on this unicast actor. The router never terminates by policy and requires
only Bombay Address and Communication interpretation for its send lane.
Implementations§
Source§impl<A, Route, R> Router<A, Route, R>where
A: Address,
Route: DeliveryRoute<Protocol: Protocol<Addr = A>> + Clone + PartialEq,
R: RoutingStrategy<Route>,
impl<A, Route, R> Router<A, Route, R>where
A: Address,
Route: DeliveryRoute<Protocol: Protocol<Addr = A>> + Clone + PartialEq,
R: RoutingStrategy<Route>,
Source§impl<A, Route> Router<A, Route, LeastLoaded>
impl<A, Route> Router<A, Route, LeastLoaded>
Sourcepub fn load_evidence(&self, recipient: &Route) -> Option<LoadEvidence>
pub fn load_evidence(&self, recipient: &Route) -> Option<LoadEvidence>
Borrow the current load-evidence phase of one member.
Returns None when the route is not a current member. Removal retires
its old evidence, so a later addition starts at LoadEvidence::Unknown.
Source§impl<A, Route, K> Router<A, Route, ConsistentHash<K>>
impl<A, Route, K> Router<A, Route, ConsistentHash<K>>
Sourcepub fn member_token_evidence(
&self,
recipient: &Route,
) -> Option<MemberTokenEvidence>
pub fn member_token_evidence( &self, recipient: &Route, ) -> Option<MemberTokenEvidence>
Borrow one current member’s complete stable-token evidence. Removal retires the old evidence; later addition starts Unknown.
Source§impl<A, Route, K> Router<A, Route, RendezvousHash<K>>
impl<A, Route, K> Router<A, Route, RendezvousHash<K>>
Sourcepub fn member_token_evidence(
&self,
recipient: &Route,
) -> Option<MemberTokenEvidence>
pub fn member_token_evidence( &self, recipient: &Route, ) -> Option<MemberTokenEvidence>
Borrow one current member’s complete stable-token evidence. Removal retires the old evidence; later addition starts Unknown.