aboutsummaryrefslogtreecommitdiff
path: root/src/castable_factory/blocking.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-11-07 21:01:10 +0100
committerHampusM <hampus@hampusmat.com>2022-11-07 21:01:10 +0100
commit1b27423ae2f2455c72cc7020051c861227aeeeb5 (patch)
tree8dbc1392ba63d489f05be0b93d1366a82b7fb7a3 /src/castable_factory/blocking.rs
parent0e1308d8ccf3565559084de19a9130975ca8ce78 (diff)
fix: make factories work again after Rust nightly-2022-11-07
Diffstat (limited to 'src/castable_factory/blocking.rs')
-rw-r--r--src/castable_factory/blocking.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/castable_factory/blocking.rs b/src/castable_factory/blocking.rs
index 48f426d..f16d86a 100644
--- a/src/castable_factory/blocking.rs
+++ b/src/castable_factory/blocking.rs
@@ -1,5 +1,6 @@
use std::any::type_name;
use std::fmt::Debug;
+use std::marker::Tuple;
use crate::interfaces::any_factory::AnyFactory;
use crate::interfaces::factory::IFactory;
@@ -7,7 +8,7 @@ use crate::ptr::TransientPtr;
pub struct CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
func: &'static dyn Fn<Args, Output = TransientPtr<ReturnInterface>>,
@@ -15,7 +16,7 @@ where
impl<Args, ReturnInterface> CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
pub fn new(
@@ -29,14 +30,14 @@ where
impl<Args, ReturnInterface> IFactory<Args, ReturnInterface>
for CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
}
impl<Args, ReturnInterface> Fn<Args> for CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
extern "rust-call" fn call(&self, args: Args) -> Self::Output
@@ -47,7 +48,7 @@ where
impl<Args, ReturnInterface> FnMut<Args> for CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output
@@ -58,7 +59,7 @@ where
impl<Args, ReturnInterface> FnOnce<Args> for CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
type Output = TransientPtr<ReturnInterface>;
@@ -71,14 +72,14 @@ where
impl<Args, ReturnInterface> AnyFactory for CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
}
impl<Args, ReturnInterface> Debug for CastableFactory<Args, ReturnInterface>
where
- Args: 'static,
+ Args: Tuple + 'static,
ReturnInterface: 'static + ?Sized,
{
#[cfg(not(tarpaulin_include))]