[−][src]Struct js_sys::DataView
Methods
impl DataView[src]
impl DataViewpub fn new(
buffer: &ArrayBuffer,
byteOffset: usize,
byteLength: usize
) -> DataView[src]
pub fn new(
buffer: &ArrayBuffer,
byteOffset: usize,
byteLength: usize
) -> DataViewThe DataView view provides a low-level interface for reading and
writing multiple number types in an ArrayBuffer irrespective of the
platform's endianness.
impl DataView[src]
impl DataViewpub fn buffer(&self) -> ArrayBuffer[src]
pub fn buffer(&self) -> ArrayBufferThe ArrayBuffer referenced by this view. Fixed at construction time and thus read only.
impl DataView[src]
impl DataViewpub fn byte_length(&self) -> usize[src]
pub 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[src]
impl DataViewpub fn byte_offset(&self) -> usize[src]
pub 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[src]
impl DataViewpub fn get_int8(&self, byte_offset: usize) -> i8[src]
pub 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[src]
impl DataViewpub fn get_uint8(&self, byte_offset: usize) -> u8[src]
pub 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[src]
impl DataViewpub fn get_int16(&self, byte_offset: usize) -> i16[src]
pub fn get_int16(&self, byte_offset: usize) -> i16The getInt16() method gets a signed 16-bit integer (byte) at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn get_int16_endian(&self, byte_offset: usize, little_endian: bool) -> i16[src]
pub fn get_int16_endian(&self, byte_offset: usize, little_endian: bool) -> i16The getInt16() method gets a signed 16-bit integer (byte) at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn get_uint16(&self, byte_offset: usize) -> u16[src]
pub fn get_uint16(&self, byte_offset: usize) -> u16The getUint16() an unsigned 16-bit integer (unsigned byte) at the specified byte offset from the start of the view.
impl DataView[src]
impl DataViewpub fn get_uint16_endian(&self, byte_offset: usize, little_endian: bool) -> u16[src]
pub fn get_uint16_endian(&self, byte_offset: usize, little_endian: bool) -> u16The getUint16() an unsigned 16-bit integer (unsigned byte) at the specified byte offset from the start of the view.
impl DataView[src]
impl DataViewpub fn get_int32(&self, byte_offset: usize) -> i32[src]
pub fn get_int32(&self, byte_offset: usize) -> i32The getInt32() method gets a signed 32-bit integer (byte) at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn get_int32_endian(&self, byte_offset: usize, little_endian: bool) -> i32[src]
pub fn get_int32_endian(&self, byte_offset: usize, little_endian: bool) -> i32The getInt32() method gets a signed 32-bit integer (byte) at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn get_uint32(&self, byte_offset: usize) -> u32[src]
pub fn get_uint32(&self, byte_offset: usize) -> u32The getUint32() an unsigned 32-bit integer (unsigned byte) at the specified byte offset from the start of the view.
impl DataView[src]
impl DataViewpub fn get_uint32_endian(&self, byte_offset: usize, little_endian: bool) -> u32[src]
pub fn get_uint32_endian(&self, byte_offset: usize, little_endian: bool) -> u32The getUint32() an unsigned 32-bit integer (unsigned byte) at the specified byte offset from the start of the view.
impl DataView[src]
impl DataViewpub fn get_float32(&self, byte_offset: usize) -> f32[src]
pub 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[src]
impl DataViewpub fn get_float32_endian(&self, byte_offset: usize, little_endian: bool) -> f32[src]
pub 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[src]
impl DataViewpub fn get_float64(&self, byte_offset: usize) -> f64[src]
pub fn get_float64(&self, byte_offset: usize) -> f64The getFloat64() method gets a signed 64-bit float (float) at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn get_float64_endian(&self, byte_offset: usize, little_endian: bool) -> f64[src]
pub fn get_float64_endian(&self, byte_offset: usize, little_endian: bool) -> f64The getFloat64() method gets a signed 64-bit float (float) at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_int8(&self, byte_offset: usize, value: i8)[src]
pub 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[src]
impl DataViewpub fn set_uint8(&self, byte_offset: usize, value: u8)[src]
pub 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[src]
impl DataViewpub fn set_int16(&self, byte_offset: usize, value: i16)[src]
pub fn set_int16(&self, byte_offset: usize, value: i16)The setInt16() method stores a signed 16-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_int16_endian(
&self,
byte_offset: usize,
value: i16,
little_endian: bool
)[src]
pub fn set_int16_endian(
&self,
byte_offset: usize,
value: i16,
little_endian: bool
)The setInt16() method stores a signed 16-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_uint16(&self, byte_offset: usize, value: u16)[src]
pub fn set_uint16(&self, byte_offset: usize, value: u16)The setUint16() method stores an unsigned 16-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_uint16_endian(
&self,
byte_offset: usize,
value: u16,
little_endian: bool
)[src]
pub fn set_uint16_endian(
&self,
byte_offset: usize,
value: u16,
little_endian: bool
)The setUint16() method stores an unsigned 16-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_int32(&self, byte_offset: usize, value: i32)[src]
pub fn set_int32(&self, byte_offset: usize, value: i32)The setInt32() method stores a signed 32-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_int32_endian(
&self,
byte_offset: usize,
value: i32,
little_endian: bool
)[src]
pub fn set_int32_endian(
&self,
byte_offset: usize,
value: i32,
little_endian: bool
)The setInt32() method stores a signed 32-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_uint32(&self, byte_offset: usize, value: u32)[src]
pub fn set_uint32(&self, byte_offset: usize, value: u32)The setUint32() method stores an unsigned 32-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_uint32_endian(
&self,
byte_offset: usize,
value: u32,
little_endian: bool
)[src]
pub fn set_uint32_endian(
&self,
byte_offset: usize,
value: u32,
little_endian: bool
)The setUint32() method stores an unsigned 32-bit integer (byte) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_float32(&self, byte_offset: usize, value: f32)[src]
pub 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[src]
impl DataViewpub fn set_float32_endian(
&self,
byte_offset: usize,
value: f32,
little_endian: bool
)[src]
pub 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[src]
impl DataViewpub fn set_float64(&self, byte_offset: usize, value: f64)[src]
pub fn set_float64(&self, byte_offset: usize, value: f64)The setFloat64() method stores a signed 64-bit float (float) value at the specified byte offset from the start of the DataView.
impl DataView[src]
impl DataViewpub fn set_float64_endian(
&self,
byte_offset: usize,
value: f64,
little_endian: bool
)[src]
pub fn set_float64_endian(
&self,
byte_offset: usize,
value: f64,
little_endian: bool
)The setFloat64() method stores a signed 64-bit float (float) value at the specified byte offset from the start of the DataView.
Methods from Deref<Target = Object>
pub fn has_own_property(&self, property: &JsValue) -> bool[src]
pub fn has_own_property(&self, property: &JsValue) -> boolThe hasOwnProperty() method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
pub fn is_prototype_of(&self, value: &JsValue) -> bool[src]
pub fn is_prototype_of(&self, value: &JsValue) -> boolThe isPrototypeOf() method checks if an object exists in another
object's prototype chain.
pub fn property_is_enumerable(&self, property: &JsValue) -> bool[src]
pub fn property_is_enumerable(&self, property: &JsValue) -> boolThe propertyIsEnumerable() method returns a Boolean indicating
whether the specified property is enumerable.
pub fn to_locale_string(&self) -> JsString[src]
pub fn to_locale_string(&self) -> JsStringThe toLocaleString() method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
pub fn to_string(&self) -> JsString[src]
pub fn to_string(&self) -> JsStringThe toString() method returns a string representing the object.
pub fn value_of(&self) -> Object[src]
pub fn value_of(&self) -> ObjectThe valueOf() method returns the primitive value of the
specified object.
Trait Implementations
impl AsRef<JsValue> for DataView[src]
impl AsRef<JsValue> for DataViewimpl AsRef<Object> for DataView[src]
impl AsRef<Object> for DataViewimpl From<JsValue> for DataView[src]
impl From<JsValue> for DataViewimpl From<DataView> for JsValue[src]
impl From<DataView> for JsValueimpl From<DataView> for Object[src]
impl From<DataView> for Objectimpl Clone for DataView[src]
impl Clone for DataViewfn clone(&self) -> DataView[src]
fn clone(&self) -> DataViewfn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for DataView[src]
impl Debug for DataViewimpl Deref for DataView[src]
impl Deref for DataViewimpl WasmDescribe for DataView[src]
impl WasmDescribe for DataViewimpl IntoWasmAbi for DataView[src]
impl IntoWasmAbi for DataViewtype Abi = <JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi[src]
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abiimpl<'a> IntoWasmAbi for &'a DataView[src]
impl<'a> IntoWasmAbi for &'a DataViewtype Abi = <&'a JsValue as IntoWasmAbi>::Abi
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abi[src]
fn into_abi(self, extra: &mut dyn Stack) -> Self::Abiimpl FromWasmAbi for DataView[src]
impl FromWasmAbi for DataViewtype Abi = <JsValue as FromWasmAbi>::Abi
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self[src]
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Selfimpl OptionFromWasmAbi for DataView[src]
impl OptionFromWasmAbi for DataViewimpl RefFromWasmAbi for DataView[src]
impl RefFromWasmAbi for DataViewtype Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self are recovered from.
type Anchor = ManuallyDrop<DataView>
The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchor[src]
unsafe fn ref_from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self::Anchorimpl OptionIntoWasmAbi for DataView[src]
impl OptionIntoWasmAbi for DataViewimpl<'a> OptionIntoWasmAbi for &'a DataView[src]
impl<'a> OptionIntoWasmAbi for &'a DataViewimpl JsCast for DataView[src]
impl JsCast for DataViewfn instanceof(val: &JsValue) -> bool[src]
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Self[src]
fn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self[src]
fn unchecked_from_js_ref(val: &JsValue) -> &Selffn is_instance_of<T>(&self) -> bool where
T: JsCast, [src]
fn is_instance_of<T>(&self) -> bool where
T: JsCast, Test whether this JS value is an instance of the type T. Read more
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast, [src]
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast, Performs a dynamic cast (checked at runtime) of this value into the target type T. Read more
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast, [src]
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast, Performs a dynamic cast (checked at runtime) of this value into the target type T. Read more
fn unchecked_into<T>(self) -> T where
T: JsCast, [src]
fn unchecked_into<T>(self) -> T where
T: JsCast, Performs a zero-cost unchecked cast into the specified type. Read more
fn unchecked_ref<T>(&self) -> &T where
T: JsCast, [src]
fn unchecked_ref<T>(&self) -> &T where
T: JsCast, Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi, [src]
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi, type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi[src]
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi