Struct DataView

#[repr(transparent)]
pub struct DataView { /* private fields */ }

Implementations

impl DataView

fn get_float16_as_f32(&self, byte_offset: usize) -> f32

The getFloat16() method gets a signed 16-bit float at the specified byte offset from the start of the DataView as an f32.

The unsuffixed get_float16 name is reserved for a future native f16 binding once Rust stabilizes the type.

MDN documentation

impl DataView

fn get_float64_endian(&self, byte_offset: usize, little_endian: bool) -> f64

The getFloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

impl DataView

fn new(buffer: &ArrayBuffer, byteOffset: usize, byteLength: usize) -> DataView

The DataView view provides a low-level interface for reading and writing multiple number types in an ArrayBuffer irrespective of the platform's endianness.

MDN documentation

impl DataView

fn byte_length(&self) -> usize

The length (in bytes) of this view from the start of its ArrayBuffer. Fixed at construction time and thus read only.

MDN documentation

impl DataView

fn get_uint8(&self, byte_offset: usize) -> u8

The getUint8() method gets a unsigned 8-bit integer (byte) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_uint16(&self, byte_offset: usize) -> u16

The getUint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view.

MDN documentation

impl DataView

fn get_int32_endian(&self, byte_offset: usize, little_endian: bool) -> i32

The getInt32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_float32(&self, byte_offset: usize) -> f32

The getFloat32() method gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_float16_endian_as_f32(&self, byte_offset: usize, little_endian: bool) -> f32

The getFloat16() method gets a signed 16-bit float at the specified byte offset from the start of the DataView as an f32.

The unsuffixed get_float16_endian name is reserved for a future native f16 binding once Rust stabilizes the type.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

impl DataView

fn set_float16_from_f32(&self, byte_offset: usize, value: f32)

The setFloat16() method stores a signed 16-bit float value from an f32 at the specified byte offset from the start of the DataView.

The unsuffixed set_float16 name is reserved for a future native f16 binding once Rust stabilizes the type.

MDN documentation

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.

MDN documentation

impl DataView

fn new_with_shared_array_buffer(buffer: &SharedArrayBuffer, byteOffset: usize, byteLength: usize) -> DataView

The DataView view provides a low-level interface for reading and writing multiple number types in an ArrayBuffer irrespective of the platform's endianness.

MDN documentation

impl DataView

fn byte_offset(&self) -> usize

The offset (in bytes) of this view from the start of its ArrayBuffer. Fixed at construction time and thus read only.

MDN documentation

impl DataView

fn get_int16(&self, byte_offset: usize) -> i16

The getInt16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_uint16_endian(&self, byte_offset: usize, little_endian: bool) -> u16

The getUint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view.

MDN documentation

impl DataView

fn get_uint32(&self, byte_offset: usize) -> u32

The getUint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the view.

MDN documentation

impl DataView

fn get_float32_endian(&self, byte_offset: usize, little_endian: bool) -> f32

The getFloat32() method gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_float64(&self, byte_offset: usize) -> f64

The getFloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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.

MDN documentation

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 an f32 at the specified byte offset from the start of the DataView.

The unsuffixed set_float16_endian name is reserved for a future native f16 binding once Rust stabilizes the type.

MDN documentation

impl DataView

fn buffer(&self) -> ArrayBuffer

The ArrayBuffer referenced by this view. Fixed at construction time and thus read only.

MDN documentation

impl DataView

fn get_int8(&self, byte_offset: usize) -> i8

The getInt8() method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_int16_endian(&self, byte_offset: usize, little_endian: bool) -> i16

The getInt16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_int32(&self, byte_offset: usize) -> i32

The getInt32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView.

MDN documentation

impl DataView

fn get_uint32_endian(&self, byte_offset: usize, little_endian: bool) -> u32

The getUint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the view.

MDN documentation

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) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn 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()

Auto Trait Implementations

impl Freeze for DataView

impl RefUnwindSafe for DataView

impl Send for DataView

impl Sync for DataView

impl Unpin for DataView

impl UnsafeUnpin for DataView

impl UnwindSafe for DataView

Blanket Implementations

impl<P, T> Receiver for DataView where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for DataView where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for DataView where T: 'static + ?Sized,

impl<T> Borrow<T> for DataView where T: ?Sized,

impl<T> BorrowMut<T> for DataView where T: ?Sized,

impl<T> CloneToUninit for DataView where T: Clone,

impl<T> From<T> for DataView

impl<T> JsGeneric for DataView where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for DataView where T: IntoWasmAbi,

impl<T> ToOwned for DataView where T: Clone,

impl<T> TryFromJsValue for DataView where T: JsCast,

impl<T> VectorFromWasmAbi for DataView where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for DataView where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for DataView where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for DataView where U: From<T>,

impl<T, U> TryFrom<U> for DataView where U: Into<T>,

impl<T, U> TryInto<U> for DataView where U: TryFrom<T>,