pub struct Graphul<S = ()> { /* private fields */ }Implementations§
Source§impl Graphul<()>
impl Graphul<()>
pub fn new() -> Self
pub fn router() -> Self
pub fn get<T, H>(path: &str, handler: H) -> Graphul
pub fn state_get<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn post<T, H>(path: &str, handler: H) -> Graphul
pub fn state_post<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn put<T, H>(path: &str, handler: H) -> Graphul
pub fn state_put<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn delete<T, H>(path: &str, handler: H) -> Graphul
pub fn state_delete<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn patch<T, H>(path: &str, handler: H) -> Graphul
pub fn state_patch<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn options<T, H>(path: &str, handler: H) -> Graphul
pub fn state_options<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn trace<T, H>(path: &str, handler: H) -> Graphul
pub fn state_trace<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
pub fn head<T, H>(path: &str, handler: H) -> Graphul
pub fn state_head<T, H, S>(state: S, path: &str, handler: H) -> Graphul<S>
Source§impl<S> Graphul<S>
impl<S> Graphul<S>
pub fn routes(&self) -> Vec<String>
pub fn merge<R>(&mut self, route: R)
pub fn add_router(&mut self, route: Graphul<S>)
pub fn add_routers(&mut self, routes: Vec<Graphul<S>>)
pub fn set_server_file_config( &self, file_dir: String, compress: bool, chunk_size: Option<usize>, ) -> ServeFile
pub fn static_files( &mut self, path: &'static str, dir: &'static str, config: FolderConfig, )
pub fn static_file( &mut self, path: &'static str, file: &'static str, config: FileConfig, )
pub fn middleware<L>(&mut self, service: L)where
L: Layer<Route<Body>> + Clone + Send + 'static,
L::Service: Service<Request<Body>> + Clone + Send + 'static,
<L::Service as Service<Request<Body>>>::Response: IntoResponse + 'static,
<L::Service as Service<Request<Body>>>::Error: Into<Infallible> + 'static,
<L::Service as Service<Request<Body>>>::Future: Send + 'static,
pub fn group(&mut self, name: &str) -> Group<'_, S>
pub fn export_routes(self) -> Router
pub async fn run(self, addr: &str)
Trait Implementations§
Source§impl<S> Methods<S, Body> for Graphul<S>
impl<S> Methods<S, Body> for Graphul<S>
fn get<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn post<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn put<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn delete<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn head<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn options<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn patch<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
fn trace<T, H>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
Auto Trait Implementations§
impl<S> Freeze for Graphul<S>where
S: Freeze,
impl<S = ()> !RefUnwindSafe for Graphul<S>
impl<S> Send for Graphul<S>where
S: Send,
impl<S = ()> !Sync for Graphul<S>
impl<S> Unpin for Graphul<S>where
S: Unpin,
impl<S = ()> !UnwindSafe for Graphul<S>
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