Skip to content

Commit

Permalink
Mark FnPtr::from_fn volatile
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed Jan 22, 2025
1 parent 387a4cb commit 7204ea3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/types/fn_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ impl FnPtr {
/// # Errors
///
/// Returns an error if the function name is not a valid identifier or is a reserved keyword.
///
/// # WARNING - Unstable API
///
/// This API is volatile and may change in the future.
///
/// # Callback Function Signature
///
/// `Fn(context: NativeCallContext, &mut [&mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>`
#[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."]
#[inline(always)]
pub fn from_fn(
name: impl Into<ImmutableString>,
Expand All @@ -109,13 +118,23 @@ impl FnPtr {
+ Sync
+ 'static,
) -> RhaiResultOf<Self> {
#[allow(deprecated)]
Self::from_dyn_fn(name, Box::new(func))
}
/// Create a new function pointer from a native Rust function.
///
/// # Errors
///
/// Returns an error if the function name is not a valid identifier or is a reserved keyword.
///
/// # WARNING - Unstable API
///
/// This API is volatile and may change in the future.
///
/// # Callback Function Signature
///
/// `Fn(context: NativeCallContext, &mut [&mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>`
#[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."]
#[inline]
pub fn from_dyn_fn(
name: impl Into<ImmutableString>,
Expand Down

0 comments on commit 7204ea3

Please sign in to comment.