pub struct HandlerEntry {
pub factory: fn(&dyn IServiceResolver) -> Result<Box<dyn Any + Send>>,
pub call: fn(handler: Box<dyn Any + Send>, request: Box<dyn Any + Send>) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>>> + Send>>,
}Expand description
A single compiled handler entry in the registry.
Stores only the factory and call bridge — no cached instance. The factory is called per request to produce a fresh owned handler.
Fields§
§factory: fn(&dyn IServiceResolver) -> Result<Box<dyn Any + Send>>Per-request factory: receives the scoped resolver, returns an owned handler.
call: fn(handler: Box<dyn Any + Send>, request: Box<dyn Any + Send>) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>>> + Send>>Type-erased call bridge: invokes handle(&mut self, req) on the owned handler.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandlerEntry
impl RefUnwindSafe for HandlerEntry
impl Send for HandlerEntry
impl Sync for HandlerEntry
impl Unpin for HandlerEntry
impl UnsafeUnpin for HandlerEntry
impl UnwindSafe for HandlerEntry
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