Struct ArrayBuffer
#[repr(transparent)]
pub struct ArrayBuffer { /* private fields */ }
Implementations
impl ArrayBuffer
fn new(length: u32) -> ArrayBufferThe
ArrayBufferobject is used to represent a generic, fixed-length raw binary data buffer. You cannot directly manipulate the contents of anArrayBuffer; instead, you create one of the typed array objects or aDataViewobject which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
impl ArrayBuffer
fn detached(&self) -> boolThe
detachedaccessor property ofArrayBufferinstances returns a boolean indicating whether or not this buffer has been detached (transferred).
impl ArrayBuffer
fn resizable(&self) -> boolThe
resizableaccessor property ofArrayBufferinstances returns whether this array buffer can be resized or not.
impl ArrayBuffer
fn slice_from(&self, begin: isize) -> ArrayBufferThe
slice()method returns a newArrayBufferwhose contents are a copy of thisArrayBuffer's bytes from begin, inclusive, up to end, exclusive.
impl ArrayBuffer
fn transfer_with_length(&self, new_byte_length: usize) -> Result<ArrayBuffer, JsValue>The
transfer()method ofArrayBufferinstances creates a newArrayBufferwith the same byte content as this buffer, then detaches this buffer.
impl ArrayBuffer
fn new_with_options(length: usize, options: &ArrayBufferOptions) -> ArrayBufferThe
ArrayBufferobject is used to represent a generic, fixed-length raw binary data buffer. You cannot directly manipulate the contents of anArrayBuffer; instead, you create one of the typed array objects or aDataViewobject which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
impl ArrayBuffer
fn is_view(value: &JsValue) -> boolThe
isView()method returns true if arg is one of theArrayBufferviews, such as typed array objects or a DataView; false otherwise.
impl ArrayBuffer
fn resize(&self, new_len: usize) -> Result<(), JsValue>The
resize()method of ArrayBuffer instances resizes the ArrayBuffer to the specified size, in bytes.
impl ArrayBuffer
fn slice_with_end(&self, begin: u32, end: u32) -> ArrayBufferLike
slice()but with theendargument.
impl ArrayBuffer
fn transfer_to_fixed_length(&self) -> Result<ArrayBuffer, JsValue>The
transferToFixedLength()method ofArrayBufferinstances creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.
impl ArrayBuffer
fn byte_length(&self) -> u32The
byteLengthproperty of an object which is an instance of type ArrayBuffer it's an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this ArrayBuffer has been detached.
impl ArrayBuffer
fn max_byte_length(&self) -> usizeThe
maxByteLengthaccessor property of ArrayBuffer instances returns the maximum length (in bytes) that this array buffer can be resized to.
impl ArrayBuffer
fn slice(&self, begin: u32) -> ArrayBufferThe
slice()method returns a newArrayBufferwhose contents are a copy of thisArrayBuffer's bytes from begin, inclusive, up to end, exclusive.
impl ArrayBuffer
fn transfer(&self) -> Result<ArrayBuffer, JsValue>The
transfer()method of ArrayBuffer instances creates a newArrayBufferwith the same byte content as this buffer, then detaches this buffer.
impl ArrayBuffer
fn transfer_to_fixed_length_with_length(&self, new_byte_length: usize) -> Result<ArrayBuffer, JsValue>The
transferToFixedLength()method ofArrayBufferinstances creates a new non-resizableArrayBufferwith the same byte content as this buffer, then detaches this buffer.
Trait Implementations
impl AsRef<ArrayBuffer> for ArrayBuffer
fn as_ref(&self) -> &ArrayBuffer
impl AsRef<JsValue> for ArrayBuffer
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for ArrayBuffer
fn as_ref(&self) -> &Object
impl Clone for ArrayBuffer
fn clone(&self) -> Self
impl Debug for ArrayBuffer
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Deref for ArrayBuffer
type Target = Object;fn deref(&self) -> &Object
impl Eq for ArrayBuffer
impl ErasableGeneric for ArrayBuffer
type Repr = JsValue;
impl From<JsValue> for ArrayBuffer
fn from(obj: JsValue) -> Self
impl FromWasmAbi for ArrayBuffer
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for ArrayBuffer
where
ArrayBuffer: JsGeneric,
type JsCanon = ArrayBuffer;fn to_js(self) -> ArrayBuffer
impl IntoWasmAbi for ArrayBuffer
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for ArrayBuffer
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for ArrayBuffer
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = ArrayBuffer;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for ArrayBuffer
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for ArrayBuffer
fn none() -> Self::Abi
impl PartialEq for ArrayBuffer
fn eq(&self, other: &Self) -> bool
impl Promising for ArrayBuffer
type Resolution = ArrayBuffer;
impl RefFromWasmAbi for ArrayBuffer
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<ArrayBuffer>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl StructuralPartialEq for ArrayBuffer
impl UpcastFrom<&[u8]> for ArrayBuffer
impl UpcastFrom<ArrayBuffer> for ArrayBuffer
impl WasmDescribe for ArrayBuffer
fn describe()