FnContextSendSyncStatic

Trait FnContextSendSyncStatic 

Source
pub trait FnContextSendSyncStatic<Fut, T>: FnContextSendSync<Fut> + 'static
where Fut: Future<Output = T> + Send,
{ }
Expand description

A trait for static, sendable, synchronous functions that return a future.

This trait ensures that a handler function is safe to be sent across threads and has a static lifetime, making it suitable for use in long-lived components of the application, such as the main router.

Implementors§

Source§

impl<F, Fut, T> FnContextSendSyncStatic<Fut, T> for F
where F: FnContextSendSync<Fut> + 'static, Fut: Future<Output = T> + Send,

A blanket implementation for static, sendable, synchronous functions that return a future.

This trait is used for handlers that are known at compile time, ensuring they are safe to be sent across threads and have a static lifetime. This is crucial for handlers that are part of the application’s long-lived state.