Struct quad_compat_rhai::FnCallHashes [−][src]
Expand description
(internals) A set of function call hashes. Exported under the internals
feature only.
Two separate hashes are pre-calculated because of the following patterns:
func(a, b, c); // Native: func(a, b, c) - 3 parameters
// Script: func(a, b, c) - 3 parameters
a.func(b, c); // Native: func(&mut a, b, c) - 3 parameters
// Script: func(b, c) - 2 parameters
For normal function calls, the native hash equals the script hash.
For method-style calls, the script hash contains one fewer parameter.
Function call hashes are used in the following manner:
-
First, the script hash is tried, which contains only the called function’s name plus the number of parameters.
-
Next, the actual types of arguments are hashed and combined with the native hash, which is then used to search for a native function. In other words, a complete native function call hash always contains the called function’s name plus the types of the arguments. This is due to possible function overloading for different parameter types.
Fields
script: u64
Pre-calculated hash for a script-defined function (zero if native functions only).
native: u64
Pre-calculated hash for a native Rust function with no parameter types.
Implementations
Create a FnCallHashes
with only the native Rust hash.
Create a FnCallHashes
with both native Rust and script function hashes.
Is this FnCallHashes
native Rust only?
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for FnCallHashes
impl Send for FnCallHashes
impl Sync for FnCallHashes
impl Unpin for FnCallHashes
impl UnwindSafe for FnCallHashes
Blanket Implementations
Mutably borrows from an owned value. Read more