Struct ArrayBuffer

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

Implementations

impl ArrayBuffer

fn new(length: u32) -> ArrayBuffer

The ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. You cannot directly manipulate the contents of an ArrayBuffer; instead, you create one of the typed array objects or a DataView object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.

MDN documentation

impl ArrayBuffer

fn detached(&self) -> bool

The detached accessor property of ArrayBuffer instances returns a boolean indicating whether or not this buffer has been detached (transferred).

MDN documentation

impl ArrayBuffer

fn resizable(&self) -> bool

The resizable accessor property of ArrayBuffer instances returns whether this array buffer can be resized or not.

MDN documentation

impl ArrayBuffer

fn slice_from(&self, begin: isize) -> ArrayBuffer

The slice() method returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from begin, inclusive, up to end, exclusive.

MDN documentation

impl ArrayBuffer

fn transfer_with_length(&self, new_byte_length: usize) -> Result<ArrayBuffer, JsValue>

The transfer() method of ArrayBuffer instances creates a new ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

MDN documentation

impl ArrayBuffer

fn new_with_options(length: usize, options: &ArrayBufferOptions) -> ArrayBuffer

The ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. You cannot directly manipulate the contents of an ArrayBuffer; instead, you create one of the typed array objects or a DataView object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.

MDN documentation

impl ArrayBuffer

fn is_view(value: &JsValue) -> bool

The isView() method returns true if arg is one of the ArrayBuffer views, such as typed array objects or a DataView; false otherwise.

MDN documentation

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.

MDN documentation

impl ArrayBuffer

fn slice_with_end(&self, begin: u32, end: u32) -> ArrayBuffer

Like slice() but with the end argument.

MDN documentation

impl ArrayBuffer

fn transfer_to_fixed_length(&self) -> Result<ArrayBuffer, JsValue>

The transferToFixedLength() method of ArrayBuffer instances creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

MDN documentation

impl ArrayBuffer

fn byte_length(&self) -> u32

The byteLength property 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.

MDN documentation

impl ArrayBuffer

fn max_byte_length(&self) -> usize

The maxByteLength accessor property of ArrayBuffer instances returns the maximum length (in bytes) that this array buffer can be resized to.

MDN documentation

impl ArrayBuffer

fn slice(&self, begin: u32) -> ArrayBuffer

The slice() method returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from begin, inclusive, up to end, exclusive.

MDN documentation

impl ArrayBuffer

fn transfer(&self) -> Result<ArrayBuffer, JsValue>

The transfer() method of ArrayBuffer instances creates a new ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

MDN documentation

impl ArrayBuffer

fn transfer_to_fixed_length_with_length(&self, new_byte_length: usize) -> Result<ArrayBuffer, JsValue>

The transferToFixedLength() method of ArrayBuffer instances creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

MDN documentation

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

Auto Trait Implementations

impl Freeze for ArrayBuffer

impl RefUnwindSafe for ArrayBuffer

impl Send for ArrayBuffer

impl Sync for ArrayBuffer

impl Unpin for ArrayBuffer

impl UnsafeUnpin for ArrayBuffer

impl UnwindSafe for ArrayBuffer

Blanket Implementations

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

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

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

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

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

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

impl<T> From<T> for ArrayBuffer

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

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

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

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

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

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

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

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

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

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