pub struct SparseSetFunctions {
pub contains: FunctionIdx,
pub insert: FunctionIdx,
}
Expand description
This struct contains the sparse set functions
Fields§
§contains: FunctionIdx
§insert: FunctionIdx
Implementations§
Source§impl SparseSetFunctions
impl SparseSetFunctions
Sourcepub fn new(ctx: &mut CompileContext, layout: &SparseSetLayout) -> Self
pub fn new(ctx: &mut CompileContext, layout: &SparseSetLayout) -> Self
Register all the sparse set functions and save their
FunctionIdx
s.
Sourcefn contains_fn(layout: &SparseSetLayout) -> Function
fn contains_fn(layout: &SparseSetLayout) -> Function
Returns a WASM function that will check whether a given state ID is present in the set or not.
If it is present, it returns 1
, else it returns 0
Sourcefn insert_fn(layout: &SparseSetLayout, contains: FunctionIdx) -> Function
fn insert_fn(layout: &SparseSetLayout, contains: FunctionIdx) -> Function
Returns a WASM function that will insert the state ID value into this
set and return 1
if the given state ID was not previously in this
set.
This operation is idempotent. If the given value is already in this set, then this is a no-op.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SparseSetFunctions
impl RefUnwindSafe for SparseSetFunctions
impl Send for SparseSetFunctions
impl Sync for SparseSetFunctions
impl Unpin for SparseSetFunctions
impl UnwindSafe for SparseSetFunctions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more