Struct neon::prelude::BinaryData [−][src]
#[repr(C)]pub struct BinaryData<'a> { /* fields omitted */ }
Expand description
A reference to the internal backing buffer data of a Buffer
or ArrayBuffer
object, which can be accessed via the Borrow
and BorrowMut
traits.
Implementations
impl<'a> BinaryData<'a>
[src]
impl<'a> BinaryData<'a>
[src]pub fn as_slice<T: BinaryViewType>(self) -> &'a [T]
[src]
pub fn as_slice<T: BinaryViewType>(self) -> &'a [T]
[src]Produces an immutable slice as a view into the contents of this buffer.
Example:
let b: Handle<JsArrayBuffer> = cx.argument(0)?; let (x, y) = cx.borrow(&b, |data| { let slice = data.as_slice::<i32>(); (slice[0], slice[1]) });
pub fn as_mut_slice<T: BinaryViewType>(self) -> &'a mut [T]
[src]
pub fn as_mut_slice<T: BinaryViewType>(self) -> &'a mut [T]
[src]Produces a mutable slice as a view into the contents of this buffer.
Example:
let mut b: Handle<JsArrayBuffer> = cx.argument(0)?; cx.borrow_mut(&mut b, |data| { let slice = data.as_mut_slice::<f64>(); slice[0] /= 2.0; slice[1] *= 2.0; });
Trait Implementations
impl<'a> Clone for BinaryData<'a>
[src]
impl<'a> Clone for BinaryData<'a>
[src]fn clone(&self) -> BinaryData<'a>
[src]
fn clone(&self) -> BinaryData<'a>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<'a> Copy for BinaryData<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for BinaryData<'a>
impl<'a> !Send for BinaryData<'a>
impl<'a> !Sync for BinaryData<'a>
impl<'a> Unpin for BinaryData<'a>
impl<'a> UnwindSafe for BinaryData<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more