pub struct Once<T>(pub T);
A wrapper for passing FnOnce
callbacks into the js!
macro.
Since it only supports FnOnce
callbacks there is no need to
drop()
them manually on the JavaScript side provided they
were actually called.
You still need to drop()
any callbacks which were not called.
let callback = || { println!( "Hello world!" ); };
js! {
var cb = @{Once(callback)};
cb();
}
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