From 77e148fcd410db6df6fed2078986a91fdb81c59c Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Fri, 28 May 2021 14:27:41 +0300 Subject: [PATCH] Ensure that Function implements Send and Sync. Relates to #76 --- src/function/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/function/mod.rs b/src/function/mod.rs index 029b00e..21f27e5 100644 --- a/src/function/mod.rs +++ b/src/function/mod.rs @@ -41,3 +41,9 @@ impl fmt::Debug for Function { write!(f, "Function {{ [...] }}") } } + +/// A trait to ensure a type is `Send` and `Sync`. +/// If implemented for a type, the crate will not compile if the type is not `Send` and `Sync`. +trait IsSendAndSync: Send + Sync {} + +impl IsSendAndSync for Function {}