Struct DataView
#[repr(transparent)]
pub struct DataView { /* private fields */ }
Implementations
impl DataView
fn get_float16_as_f32(&self, byte_offset: usize) -> f32The
getFloat16()method gets a signed 16-bit float at the specified byte offset from the start of the DataView as anf32.The unsuffixed
get_float16name is reserved for a future nativef16binding once Rust stabilizes the type.
impl DataView
fn get_float64_endian(&self, byte_offset: usize, little_endian: bool) -> f64The
getFloat64()method gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView.
impl DataView
fn set_int16(&self, byte_offset: usize, value: i16)The
setInt16()method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_uint16_endian(&self, byte_offset: usize, value: u16, little_endian: bool)The
setUint16()method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_uint32(&self, byte_offset: usize, value: u32)The
setUint32()method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_float32_endian(&self, byte_offset: usize, value: f32, little_endian: bool)The
setFloat32()method stores a signed 32-bit float (float) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_float64(&self, byte_offset: usize, value: f64)The
setFloat64()method stores a signed 64-bit float (double) value at the specified byte offset from the start of the DataView.
impl DataView
fn new(buffer: &ArrayBuffer, byteOffset: usize, byteLength: usize) -> DataViewThe
DataViewview provides a low-level interface for reading and writing multiple number types in anArrayBufferirrespective of the platform's endianness.
impl DataView
fn byte_length(&self) -> usizeThe length (in bytes) of this view from the start of its ArrayBuffer. Fixed at construction time and thus read only.
impl DataView
fn get_uint8(&self, byte_offset: usize) -> u8The
getUint8()method gets a unsigned 8-bit integer (byte) at the specified byte offset from the start of the DataView.
impl DataView
fn get_uint16(&self, byte_offset: usize) -> u16The
getUint16()method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view.
impl DataView
fn get_int32_endian(&self, byte_offset: usize, little_endian: bool) -> i32The
getInt32()method gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView.
impl DataView
fn get_float32(&self, byte_offset: usize) -> f32The
getFloat32()method gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView.
impl DataView
fn get_float16_endian_as_f32(&self, byte_offset: usize, little_endian: bool) -> f32The
getFloat16()method gets a signed 16-bit float at the specified byte offset from the start of the DataView as anf32.The unsuffixed
get_float16_endianname is reserved for a future nativef16binding once Rust stabilizes the type.
impl DataView
fn set_int8(&self, byte_offset: usize, value: i8)The
setInt8()method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_int16_endian(&self, byte_offset: usize, value: i16, little_endian: bool)The
setInt16()method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_int32(&self, byte_offset: usize, value: i32)The
setInt32()method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_uint32_endian(&self, byte_offset: usize, value: u32, little_endian: bool)The
setUint32()method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_float16_from_f32(&self, byte_offset: usize, value: f32)The
setFloat16()method stores a signed 16-bit float value from anf32at the specified byte offset from the start of the DataView.The unsuffixed
set_float16name is reserved for a future nativef16binding once Rust stabilizes the type.
impl DataView
fn set_float64_endian(&self, byte_offset: usize, value: f64, little_endian: bool)The
setFloat64()method stores a signed 64-bit float (double) value at the specified byte offset from the start of the DataView.
impl DataView
The
DataViewview provides a low-level interface for reading and writing multiple number types in anArrayBufferirrespective of the platform's endianness.
impl DataView
fn byte_offset(&self) -> usizeThe offset (in bytes) of this view from the start of its ArrayBuffer. Fixed at construction time and thus read only.
impl DataView
fn get_int16(&self, byte_offset: usize) -> i16The
getInt16()method gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView.
impl DataView
fn get_uint16_endian(&self, byte_offset: usize, little_endian: bool) -> u16The
getUint16()method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view.
impl DataView
fn get_uint32(&self, byte_offset: usize) -> u32The
getUint32()method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the view.
impl DataView
fn get_float32_endian(&self, byte_offset: usize, little_endian: bool) -> f32The
getFloat32()method gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView.
impl DataView
fn get_float64(&self, byte_offset: usize) -> f64The
getFloat64()method gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView.
impl DataView
fn set_uint8(&self, byte_offset: usize, value: u8)The
setUint8()method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_uint16(&self, byte_offset: usize, value: u16)The
setUint16()method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_int32_endian(&self, byte_offset: usize, value: i32, little_endian: bool)The
setInt32()method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_float32(&self, byte_offset: usize, value: f32)The
setFloat32()method stores a signed 32-bit float (float) value at the specified byte offset from the start of the DataView.
impl DataView
fn set_float16_endian_from_f32(&self, byte_offset: usize, value: f32, little_endian: bool)The
setFloat16()method stores a signed 16-bit float value from anf32at the specified byte offset from the start of the DataView.The unsuffixed
set_float16_endianname is reserved for a future nativef16binding once Rust stabilizes the type.
impl DataView
fn buffer(&self) -> ArrayBufferThe ArrayBuffer referenced by this view. Fixed at construction time and thus read only.
impl DataView
fn get_int8(&self, byte_offset: usize) -> i8The
getInt8()method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the DataView.
impl DataView
fn get_int16_endian(&self, byte_offset: usize, little_endian: bool) -> i16The
getInt16()method gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView.
impl DataView
fn get_int32(&self, byte_offset: usize) -> i32The
getInt32()method gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView.
impl DataView
fn get_uint32_endian(&self, byte_offset: usize, little_endian: bool) -> u32The
getUint32()method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the view.
Trait Implementations
impl AsRef<DataView> for DataView
fn as_ref(&self) -> &DataView
impl AsRef<JsValue> for DataView
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for DataView
fn as_ref(&self) -> &Object
impl Clone for DataView
fn clone(&self) -> Self
impl Debug for DataView
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Deref for DataView
type Target = Object;fn deref(&self) -> &Object
impl Eq for DataView
impl ErasableGeneric for DataView
type Repr = JsValue;
impl From<JsValue> for DataView
fn from(obj: JsValue) -> Self
impl FromWasmAbi for DataView
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for DataView
where
DataView: JsGeneric,
type JsCanon = DataView;fn to_js(self) -> DataView
impl IntoWasmAbi for DataView
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for DataView
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for DataView
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = DataView;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for DataView
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for DataView
fn none() -> Self::Abi
impl PartialEq for DataView
fn eq(&self, other: &Self) -> bool
impl Promising for DataView
type Resolution = DataView;
impl RefFromWasmAbi for DataView
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<DataView>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl StructuralPartialEq for DataView
impl TypedArray for DataView
impl UpcastFrom<DataView> for DataView
impl WasmDescribe for DataView
fn describe()