@@ -9,38 +9,38 @@ use crate::{Request, Response, StatusCode};
99/// Internally, we have a separate state machine per http method; indexing
1010/// by the method first allows the table itself to be more efficient.
1111#[ allow( missing_debug_implementations) ]
12- pub struct Router < State > {
12+ pub ( crate ) struct Router < State > {
1313 method_map : HashMap < http_types:: Method , MethodRouter < Box < DynEndpoint < State > > > > ,
1414 all_method_router : MethodRouter < Box < DynEndpoint < State > > > ,
1515}
1616
1717/// The result of routing a URL
1818#[ allow( missing_debug_implementations) ]
19- pub struct Selection < ' a , State > {
19+ pub ( crate ) struct Selection < ' a , State > {
2020 pub ( crate ) endpoint : & ' a DynEndpoint < State > ,
2121 pub ( crate ) params : Params ,
2222}
2323
2424impl < State : Clone + Send + Sync + ' static > Router < State > {
25- pub fn new ( ) -> Self {
25+ pub ( crate ) fn new ( ) -> Self {
2626 Router {
2727 method_map : HashMap :: default ( ) ,
2828 all_method_router : MethodRouter :: new ( ) ,
2929 }
3030 }
3131
32- pub fn add ( & mut self , path : & str , method : http_types:: Method , ep : Box < DynEndpoint < State > > ) {
32+ pub ( crate ) fn add ( & mut self , path : & str , method : http_types:: Method , ep : Box < DynEndpoint < State > > ) {
3333 self . method_map
3434 . entry ( method)
3535 . or_insert_with ( MethodRouter :: new)
3636 . add ( path, ep)
3737 }
3838
39- pub fn add_all ( & mut self , path : & str , ep : Box < DynEndpoint < State > > ) {
39+ pub ( crate ) fn add_all ( & mut self , path : & str , ep : Box < DynEndpoint < State > > ) {
4040 self . all_method_router . add ( path, ep)
4141 }
4242
43- pub fn route ( & self , path : & str , method : http_types:: Method ) -> Selection < ' _ , State > {
43+ pub ( crate ) fn route ( & self , path : & str , method : http_types:: Method ) -> Selection < ' _ , State > {
4444 if let Some ( Match { handler, params } ) = self
4545 . method_map
4646 . get ( & method)
0 commit comments