Skip to content

Commit

Permalink
Add with_host fn to Router (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Aug 5, 2024
1 parent 233c49d commit 401787d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/core/src/routing/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ impl Router {
self.filter(filters::host(host))
}

/// Create a new [`HostFilter`] and set host filter.
///
/// [`HostFilter`]: super::filters::HostFilter
#[inline]
pub fn with_host(self, host: impl Into<String>) -> Self {
Router::with_filter(filters::host(host))
}

/// Add a [`PortFilter`] to current router.
///
/// [`PortFilter`]: super::filters::PortFilter
Expand Down

0 comments on commit 401787d

Please sign in to comment.