🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async framework gemini-protocol protocol gemini rust
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: fix for prelude

Fuwn 459d9376 d66da17c

+48 -43
+2 -2
README.md
··· 42 42 43 43 #[windmark::main] 44 44 async fn main() -> Result<(), Box<dyn std::error::Error>> { 45 - windmark::Router::new() 45 + windmark::router::Router::new() 46 46 .set_private_key_file("windmark_private.pem") 47 47 .set_certificate_file("windmark_public.pem") 48 48 .mount("/", windmark::success!("Hello, World!")) 49 49 .set_error_handler(|_| 50 - windmark::Response::permanent_failure("This route does not exist!") 50 + windmark::response::Response::permanent_failure("This route does not exist!") 51 51 ) 52 52 .run() 53 53 .await
+3 -2
rossweisse/README.md
··· 10 10 11 11 ```rust 12 12 use rossweisse::route; 13 + use windmark::response::Response; 13 14 14 15 #[rossweisse::router] 15 16 struct Router { ··· 21 22 #[route(index)] 22 23 pub fn index( 23 24 _context: windmark::context::RouteContext, 24 - ) -> windmark::Response { 25 - windmark::Response::success("Hello, World!") 25 + ) -> Response { 26 + Response::success("Hello, World!") 26 27 } 27 28 } 28 29
+10 -8
rossweisse/src/lib.rs
··· 39 39 /// # Examples 40 40 /// 41 41 /// ```rust 42 + /// use rossweisse::route; 43 + /// use windmark::response::Response; 44 + /// 42 45 /// #[rossweisse::router] 43 46 /// struct Router { 44 47 /// _phantom: (), ··· 47 50 /// #[rossweisse::router] 48 51 /// impl Router { 49 52 /// #[route] 50 - /// pub fn index( 51 - /// _context: windmark::context::RouteContext, 52 - /// ) -> windmark::Response { 53 - /// windmark::Response::success("Hello, World!") 53 + /// pub fn index(_context: windmark::context::RouteContext) -> Response { 54 + /// Response::success("Hello, World!") 54 55 /// } 55 56 /// } 56 57 /// ``` ··· 70 71 /// # Examples 71 72 /// 72 73 /// ```rust 74 + /// use rossweisse::route; 75 + /// use windmark::response::Response; 76 + /// 73 77 /// #[rossweisse::router] 74 78 /// impl Router { 75 79 /// #[route] 76 - /// pub fn index( 77 - /// _context: windmark::context::RouteContext, 78 - /// ) -> windmark::Response { 79 - /// windmark::Response::success("Hello, World!") 80 + /// pub fn index(_context: windmark::context::RouteContext) -> Response { 81 + /// Response::success("Hello, World!") 80 82 /// } 81 83 /// } 82 84 /// ```
+33 -31
src/router.rs
··· 112 112 /// # Examples 113 113 /// 114 114 /// ```rust 115 - /// windmark::Router::new(); 115 + /// windmark::router::Router::new(); 116 116 /// ``` 117 117 /// 118 118 /// # Panics ··· 126 126 /// # Examples 127 127 /// 128 128 /// ```rust 129 - /// windmark::Router::new().set_private_key_file("windmark_private.pem"); 129 + /// windmark::router::Router::new().set_private_key_file("windmark_private.pem"); 130 130 /// ``` 131 131 pub fn set_private_key_file( 132 132 &mut self, ··· 142 142 /// # Examples 143 143 /// 144 144 /// ```rust 145 - /// windmark::Router::new().set_certificate_file("windmark_public.pem"); 145 + /// windmark::router::Router::new().set_certificate_file("windmark_public.pem"); 146 146 /// ``` 147 147 pub fn set_certificate_file( 148 148 &mut self, ··· 160 160 /// # Examples 161 161 /// 162 162 /// ```rust 163 - /// use windmark::Response; 163 + /// use windmark::response::Response; 164 164 /// 165 - /// windmark::Router::new() 165 + /// windmark::router::Router::new() 166 166 /// .mount("/", |_| { 167 167 /// async { Response::success("This is the index page!") } 168 168 /// }) ··· 199 199 /// # Examples 200 200 /// 201 201 /// ```rust 202 - /// windmark::Router::new().set_error_handler(|_| { 203 - /// windmark::Response::success("You have encountered an error!") 202 + /// windmark::router::Router::new().set_error_handler(|_| { 203 + /// windmark::response::Response::success("You have encountered an error!") 204 204 /// }); 205 205 /// ``` 206 206 pub fn set_error_handler<R>( ··· 227 227 /// # Examples 228 228 /// 229 229 /// ```rust 230 - /// windmark::Router::new().add_header( 230 + /// windmark::router::Router::new().add_header( 231 231 /// |context: windmark::context::RouteContext| { 232 232 /// format!("This is displayed at the top of {}!", context.url.path()) 233 233 /// }, ··· 248 248 /// # Examples 249 249 /// 250 250 /// ```rust 251 - /// windmark::Router::new().add_footer( 251 + /// windmark::router::Router::new().add_footer( 252 252 /// |context: windmark::context::RouteContext| { 253 253 /// format!("This is displayed at the bottom of {}!", context.url.path()) 254 254 /// }, ··· 265 265 /// # Examples 266 266 /// 267 267 /// ```rust 268 - /// windmark::Router::new().run(); 268 + /// windmark::router::Router::new().run(); 269 269 /// ``` 270 270 /// 271 271 /// # Panics ··· 542 542 /// ```rust 543 543 /// use openssl::ssl; 544 544 /// 545 - /// windmark::Router::new().set_ssl_acceptor({ 545 + /// windmark::router::Router::new().set_ssl_acceptor({ 546 546 /// let mut builder = 547 547 /// ssl::SslAcceptor::mozilla_intermediate(ssl::SslMethod::tls()).unwrap(); 548 548 /// ··· 588 588 /// # Examples 589 589 /// 590 590 /// ```rust 591 - /// windmark::Router::new() 591 + /// windmark::router::Router::new() 592 592 /// .enable_default_logger(true) 593 593 /// .set_log_level("your_crate_name=trace", true); 594 594 /// // If you would only like to log, logs from your crate: ··· 619 619 /// ```rust 620 620 /// use log::info; 621 621 /// 622 - /// windmark::Router::new().set_pre_route_callback( 622 + /// windmark::router::Router::new().set_pre_route_callback( 623 623 /// |context: windmark::context::HookContext| { 624 624 /// info!( 625 625 /// "accepted connection from {}", ··· 644 644 /// ```rust 645 645 /// use log::info; 646 646 /// 647 - /// windmark::Router::new().set_post_route_callback( 647 + /// windmark::router::Router::new().set_post_route_callback( 648 648 /// |context: windmark::context::HookContext, 649 - /// _content: &mut windmark::Response| { 649 + /// _content: &mut windmark::response::Response| { 650 650 /// info!( 651 651 /// "closed connection from {}", 652 652 /// context.peer_address.unwrap().ip(), ··· 673 673 /// ## Integrated Module 674 674 /// 675 675 /// ```rust 676 - /// use windmark::Response; 676 + /// use windmark::response::Response; 677 677 /// 678 - /// windmark::Router::new().attach_stateless(|r| { 678 + /// windmark::router::Router::new().attach_stateless(|r| { 679 679 /// r.mount( 680 680 /// "/module", 681 681 /// Box::new(|_| Response::success("This is a module!")), ··· 691 691 /// ## External Module 692 692 /// 693 693 /// ```rust 694 - /// use windmark::Response; 694 + /// use windmark::response::Response; 695 695 /// 696 696 /// mod windmark_example { 697 - /// pub fn module(router: &mut windmark::Router) { 697 + /// pub fn module(router: &mut windmark::router::Router) { 698 698 /// router.mount( 699 699 /// "/module", 700 - /// Box::new(|_| windmark::Response::success("This is a module!")), 700 + /// Box::new(|_| { 701 + /// windmark::response::Response::success("This is a module!") 702 + /// }), 701 703 /// ); 702 704 /// } 703 705 /// } 704 706 /// 705 - /// windmark::Router::new().attach_stateless(windmark_example::module); 707 + /// windmark::router::Router::new().attach_stateless(windmark_example::module); 706 708 /// ``` 707 709 pub fn attach_stateless<F>(&mut self, mut module: F) -> &mut Self 708 710 where F: FnMut(&mut Self) { ··· 727 729 /// 728 730 /// ```rust 729 731 /// use log::info; 730 - /// use windmark::{context::HookContext, Response, Router}; 732 + /// use windmark::context::HookContext; 731 733 /// 732 734 /// #[derive(Default)] 733 735 /// struct Clicker { ··· 735 737 /// } 736 738 /// 737 739 /// #[async_trait::async_trait] 738 - /// impl windmark::AsyncModule for Clicker { 739 - /// async fn on_attach(&mut self, _: &mut Router) { 740 + /// impl windmark::module::AsyncModule for Clicker { 741 + /// async fn on_attach(&mut self, _: &mut windmark::router::Router) { 740 742 /// info!("clicker has been attached!"); 741 743 /// } 742 744 /// ··· 759 761 /// } 760 762 /// } 761 763 /// 762 - /// Router::new().attach_async(Clicker::default()); 764 + /// windmark::router::Router::new().attach_async(Clicker::default()); 763 765 /// ``` 764 766 pub fn attach_async( 765 767 &mut self, ··· 790 792 /// 791 793 /// ```rust 792 794 /// use log::info; 793 - /// use windmark::{context::HookContext, Response, Router}; 795 + /// use windmark::{context::HookContext, response::Response, router::Router}; 794 796 /// 795 797 /// #[derive(Default)] 796 798 /// struct Clicker { 797 799 /// clicks: isize, 798 800 /// } 799 801 /// 800 - /// impl windmark::Module for Clicker { 802 + /// impl windmark::module::Module for Clicker { 801 803 /// fn on_attach(&mut self, _: &mut Router) { 802 804 /// info!("clicker has been attached!"); 803 805 /// } ··· 843 845 /// # Examples 844 846 /// 845 847 /// ```rust 846 - /// windmark::Router::new().set_character_set("utf-8"); 848 + /// windmark::router::Router::new().set_character_set("utf-8"); 847 849 /// ``` 848 850 pub fn set_character_set( 849 851 &mut self, ··· 863 865 /// # Examples 864 866 /// 865 867 /// ```rust 866 - /// windmark::Router::new().set_languages(["en"]); 868 + /// windmark::router::Router::new().set_languages(["en"]); 867 869 /// ``` 868 870 pub fn set_languages<S>(&mut self, language: impl AsRef<[S]>) -> &mut Self 869 871 where S: Into<String> + AsRef<str> { ··· 883 885 /// # Examples 884 886 /// 885 887 /// ```rust 886 - /// windmark::Router::new().set_port(1965); 888 + /// windmark::router::Router::new().set_port(1965); 887 889 /// ``` 888 890 pub fn set_port(&mut self, port: i32) -> &mut Self { 889 891 self.port = port; ··· 897 899 /// # Examples 898 900 /// 899 901 /// ```rust 900 - /// windmark::Router::new().set_fix_path(true); 902 + /// windmark::router::Router::new().set_fix_path(true); 901 903 /// ``` 902 904 pub fn set_fix_path(&mut self, fix_path: bool) -> &mut Self { 903 905 self.fix_path = fix_path;