Add static cast

This commit is contained in:
hodasemi 2024-04-16 10:19:58 +02:00
parent c47ed815b6
commit ffda082363

View file

@ -18,6 +18,13 @@ pub trait FutureStateChange: Fn() -> Result<()> + Send + Sync {
{
self
}
fn as_static(&'static self) -> &'static (dyn Fn() -> Result<()> + Send + Sync + 'static)
where
Self: Sized,
{
self
}
}
impl<F: Fn() -> Result<()> + Clone + Send + Sync> FutureStateChange for F {