From 2ee5810fecb96a8d4e0d078faecc8c91096d6881 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 6 Jan 2020 12:41:42 +0100 Subject: =?UTF-8?q?Asyncify=20font=20loading=20=F0=9F=AA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/func/macros.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/func/macros.rs') diff --git a/src/func/macros.rs b/src/func/macros.rs index 2da219bc..a89156b7 100644 --- a/src/func/macros.rs +++ b/src/func/macros.rs @@ -108,9 +108,20 @@ macro_rules! function { // (2-arg) Parse a layout-definition with all arguments. (@layout $type:ident | layout($this:ident, $ctx:pat) $code:block) => { - impl $crate::func::LayoutFunc for $type { - fn layout(&$this, $ctx: LayoutContext) -> LayoutResult { - Ok($code) + impl LayoutFunc for $type { + fn layout<'a, 'life0, 'life1, 'async_trait>( + &'a $this, + $ctx: LayoutContext<'life0, 'life1> + ) -> std::pin::Pin>> + 'async_trait + >> + where + 'a: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait, + Self: 'async_trait, + { + Box::pin(async move { Ok($code) }) } } }; -- cgit v1.2.3