Struct lexa_framework::routing::Router
source · pub struct Router<UserState> {
pub name: String,
pub fullpath: String,
pub methods: HashSet<Method>,
pub action: Option<MethodRouter<State<UserState>>>,
}
Fields§
§name: String
§fullpath: String
§methods: HashSet<Method>
§action: Option<MethodRouter<State<UserState>>>
Implementations§
source§impl<US> Router<US>
impl<US> Router<US>
pub fn path(path: impl ToString + Debug) -> Self
pub fn any<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn delete<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn get<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn head<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn options<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn patch<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn post<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn put<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
pub fn trace<Action, ActionType>(self, action: Action) -> Selfwhere Action: Handler<ActionType, State<US>>, ActionType: 'static, US: 'static + Clone + Send + Sync,
source§impl<US> Router<US>
impl<US> Router<US>
pub fn layer<Layer>(self, layer: Layer) -> Selfwhere US: 'static + Clone + Send + Sync, Layer: Clone + Send + Sync + 'static + Layer<Route>, Layer::Service: Service<Request<Body>, Error = Infallible> + Clone + Send + 'static, <Layer::Service as Service<Request<Body>>>::Response: IntoResponse + 'static, <Layer::Service as Service<Request<Body>>>::Future: Send + 'static,
pub fn route_layer<Layer>(self, layer: Layer) -> Selfwhere US: 'static + Clone + Send + Sync, Layer: Clone + Send + Sync + 'static + Layer<Route>, Layer::Service: Service<Request<Body>, Error = Infallible> + Clone + Send + 'static, <Layer::Service as Service<Request<Body>>>::Response: IntoResponse + 'static, <Layer::Service as Service<Request<Body>>>::Future: Send + 'static,
Auto Trait Implementations§
impl<UserState> !RefUnwindSafe for Router<UserState>
impl<UserState> Send for Router<UserState>
impl<UserState> !Sync for Router<UserState>
impl<UserState> Unpin for Router<UserState>
impl<UserState> !UnwindSafe for Router<UserState>
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