mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
expose all fields of ServerFnTraitObj via methods
This commit is contained in:
parent
0df5dfeaf8
commit
a3a15f244d
1 changed files with 10 additions and 0 deletions
|
@ -405,6 +405,16 @@ impl<Req, Res> ServerFnTraitObj<Req, Res> {
|
|||
pub fn method(&self) -> Method {
|
||||
self.method.clone()
|
||||
}
|
||||
|
||||
/// The handler for this server function.
|
||||
pub fn handler(&self, req: Req) -> impl Future<Output = Res> + Send {
|
||||
(self.handler)(req)
|
||||
}
|
||||
|
||||
/// The set of middleware that should be applied to this function.
|
||||
pub fn middleware(&self) -> MiddlewareSet<Req, Res> {
|
||||
(self.middleware)()
|
||||
}
|
||||
}
|
||||
|
||||
impl<Req, Res> Service<Req, Res> for ServerFnTraitObj<Req, Res>
|
||||
|
|
Loading…
Reference in a new issue