pub unsafe trait ArrayBufferSource {
// Required methods
fn as_ptr(&self) -> *mut u8;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A contiguous byte region owned by self and usable as the backing store
of an ArrayBuffer.
§Safety
as_ptr()must return a pointer that is valid for reads (and writes, when used viaArrayBuffer::from_source/ArrayBuffer::from_source_shared) oflen()bytes.- The returned pointer must remain valid until
selfis dropped, including across moves ofself.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".