pub struct Mut<T>(pub T);
A wrapper for passing FnMut
callbacks into the js!
macro.
Just like when passing regular Fn
callbacks, don't forget
to drop()
them on the JavaScript side or else the closure
will be leaked.
let mut count = 0;
let callback = move || {
count += 1;
println!( "Callback called {} times", count );
};
js! {
var cb = @{Mut(callback)};
cb();
cb();
cb();
cb.drop();
}
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more