pub trait IntoArrayBuffer: Sized {
// Required method
unsafe fn into_array_buffer(texels: &[Self]) -> Object;
}Expand description
Unsafe coercion to a js_sys::Object for immutable slices.
This trait provides the into_array_buffer method, which is an unsafe operation, as
the view() method, defined on the various arrays in the js-sys crate, requires that the
underlying memory not be moved until the array is dropped.
Required Methods§
Sourceunsafe fn into_array_buffer(texels: &[Self]) -> Object
unsafe fn into_array_buffer(texels: &[Self]) -> Object
Convert the input slice into a JavaScript object.
§Unsafety
The returned Object must not outlive the input slice, which memory must not be moved either.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.