File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -545,6 +545,11 @@ impl Function {
545
545
} ) )
546
546
}
547
547
548
+ /// Wraps a Rust function or closure, returning an opaque type that implements [`IntoLua`]
549
+ /// trait.
550
+ ///
551
+ /// This function is similar to [`Function::wrap`] but any returned `Result` will be converted
552
+ /// to a `ok, err` tuple without throwing an exception.
548
553
#[ inline]
549
554
pub fn wrap_raw < F , A > ( func : F ) -> impl IntoLua
550
555
where
@@ -557,6 +562,10 @@ impl Function {
557
562
} ) )
558
563
}
559
564
565
+ /// Wraps a Rust mutable closure, returning an opaque type that implements [`IntoLua`] trait.
566
+ ///
567
+ /// This function is similar to [`Function::wrap_mut`] but any returned `Result` will be
568
+ /// converted to a `ok, err` tuple without throwing an exception.
560
569
#[ inline]
561
570
pub fn wrap_raw_mut < F , A > ( func : F ) -> impl IntoLua
562
571
where
@@ -592,6 +601,11 @@ impl Function {
592
601
} ) )
593
602
}
594
603
604
+ /// Wraps a Rust async function or closure, returning an opaque type that implements [`IntoLua`]
605
+ /// trait.
606
+ ///
607
+ /// This function is similar to [`Function::wrap_async`] but any returned `Result` will be
608
+ /// converted to a `ok, err` tuple without throwing an exception.
595
609
#[ cfg( feature = "async" ) ]
596
610
#[ cfg_attr( docsrs, doc( cfg( feature = "async" ) ) ) ]
597
611
pub fn wrap_raw_async < F , A > ( func : F ) -> impl IntoLua
You can’t perform that action at this time.
0 commit comments