take() keyword; shared test with registered functions with callbacks

This commit is contained in:
Ilya Lakhin
2020-07-31 11:41:22 +07:00
parent 060dd33046
commit ca64668e58
6 changed files with 60 additions and 11 deletions

View File

@@ -568,7 +568,7 @@ impl Dynamic {
///
/// ## Safety
///
/// Both situations normally shouldn't happen since all operations in Rhai
/// Both situations normally shouldn't happen since most operations in Rhai
/// use pass-by-value data and the script executed in a single thread.
///
/// # Example
@@ -741,7 +741,9 @@ impl Dynamic {
}
/// Get a copy of a specific type to the `Dynamic`.
/// Casting to `Dynamic` just returns a reference to it.
/// Casting to `Dynamic` returns a clone of the value in case of NON-shared
/// Dynamic. In case of Shared Dynamic returns a clone of the inner data of
/// Shared Dynamic.
/// Returns `None` if the cast fails.
#[inline(always)]
pub fn read<T: Variant + Clone>(&self) -> Option<T> {