pub struct Router<C> { /* private fields */ }Expand description
Server Blocks grouped by their Listener and ordered by Domain specificity.
Implementations§
Source§impl<C> Router<C>
impl<C> Router<C>
pub fn add( &mut self, key: ListenerKey, domain: Name, chain: Option<C>, filters: Vec<ViewFilter>, )
Sourcepub fn route(
&self,
key: &ListenerKey,
query: Message<'_>,
peer: SocketAddr,
protocol: Protocol,
) -> Option<&ServerBlock<C>>
pub fn route( &self, key: &ListenerKey, query: Message<'_>, peer: SocketAddr, protocol: Protocol, ) -> Option<&ServerBlock<C>>
Select a Server Block, or return None when the Query must be refused.
Trait Implementations§
Auto Trait Implementations§
impl<C> Forget for Router<C>
impl<C> Freeze for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: Freeze,
HashMap<ListenerKey, MetricContext<C>>: Freeze,
impl<C> Move for Router<C>
impl<C> RefUnwindSafe for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: RefUnwindSafe,
HashMap<ListenerKey, MetricContext<C>>: RefUnwindSafe,
impl<C> Send for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: Send,
HashMap<ListenerKey, MetricContext<C>>: Send,
impl<C> Sync for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: Sync,
HashMap<ListenerKey, MetricContext<C>>: Sync,
impl<C> Unpin for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: Unpin,
HashMap<ListenerKey, MetricContext<C>>: Unpin,
impl<C> UnsafeUnpin for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: UnsafeUnpin,
HashMap<ListenerKey, MetricContext<C>>: UnsafeUnpin,
impl<C> UnwindSafe for Router<C>where
HashMap<ListenerKey, Vec<ServerBlock<C>>>: UnwindSafe,
HashMap<ListenerKey, MetricContext<C>>: UnwindSafe,
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