pub struct Router {
pub tree: TrieNode<Vec<(PathRule, MethodRule, Route)>>,
/* private fields */
}
Fields§
§tree: TrieNode<Vec<(PathRule, MethodRule, Route)>>
Implementations§
Source§impl Router
impl Router
pub fn new() -> Router
pub fn lookup( &self, hostname: &str, path: &str, method: &Method, ) -> Result<Route, RouterError>
pub fn add_http_front( &mut self, front: &HttpFrontend, ) -> Result<(), RouterError>
pub fn remove_http_front( &mut self, front: &HttpFrontend, ) -> Result<(), RouterError>
pub fn add_tree_rule( &mut self, hostname: &[u8], path: &PathRule, method: &MethodRule, cluster: &Route, ) -> bool
pub fn remove_tree_rule( &mut self, hostname: &[u8], path: &PathRule, method: &MethodRule, ) -> bool
pub fn add_pre_rule( &mut self, domain: &DomainRule, path: &PathRule, method: &MethodRule, cluster_id: &Route, ) -> bool
pub fn add_post_rule( &mut self, domain: &DomainRule, path: &PathRule, method: &MethodRule, cluster_id: &Route, ) -> bool
pub fn remove_pre_rule( &mut self, domain: &DomainRule, path: &PathRule, method: &MethodRule, ) -> bool
pub fn remove_post_rule( &mut self, domain: &DomainRule, path: &PathRule, method: &MethodRule, ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Router
impl RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnwindSafe for Router
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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