pub struct TargetRouter { /* private fields */ }Expand description
The structures that handler router_name/router_id mapping requests
Implementations§
Source§impl TargetRouter
impl TargetRouter
pub fn new() -> Self
Sourcepub fn lookup_route(&self, route: &str) -> Option<u64>
pub fn lookup_route(&self, route: &str) -> Option<u64>
Returns the id of handler, if the route was already requested from server
Sourcepub async fn request_route<C: Encoder<Bytes, Error = Error> + Decoder<Item = BytesMut, Error = Error> + Clone + Send + Sync + 'static + TfCodec>(
&mut self,
route: &str,
stream: &mut Framed<Transport, C>,
processor: &mut TrafficProcessorHolder<C>,
) -> Result<u64, RouterError>
pub async fn request_route<C: Encoder<Bytes, Error = Error> + Decoder<Item = BytesMut, Error = Error> + Clone + Send + Sync + 'static + TfCodec>( &mut self, route: &str, stream: &mut Framed<Transport, C>, processor: &mut TrafficProcessorHolder<C>, ) -> Result<u64, RouterError>
Returns the id of handler, but may request id from server side.
Auto Trait Implementations§
impl Freeze for TargetRouter
impl RefUnwindSafe for TargetRouter
impl Send for TargetRouter
impl Sync for TargetRouter
impl Unpin for TargetRouter
impl UnwindSafe for TargetRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more