pub fn as_mut_slice<T: BinaryViewType>(self) -> &'a mut [T] {
        if self.size == 0 {
            &mut []
        } else {
            let base = self.base.cast();
            let len = self.size / mem::size_of::<T>();
            unsafe { slice::from_raw_parts_mut(base, len) }
        }
    }
/// Produces a mutable slice as a view into the contents of this buffer.
///
/// # Example:
///
/// ```no_run
/// # use neon::prelude::*;
/// # fn modify_buffer(mut cx: FunctionContext) -> JsResult<JsUndefined> {
/// 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;
/// });
/// # Ok(cx.undefined())
/// # }
/// ```
Produces a mutable slice as a view into the contents of this buffer.
Produces a mutable slice as a view into the contents of this buffer .
pub fn as_mut_slice<T: BinaryViewType>(self) -> &'a mut [T] {
        if self.size == 0 {
            &mut []
        } else {
            let base = self.base.cast();
            let len = self.size / mem::size_of::<T>();
            unsafe { slice::from_raw_parts_mut(base, len) }
        }
    }
pub fn as_mut_slice < T : BinaryViewType > ( self ) -> & ' a mut [ T ] { if self . size == 0 { & mut [ ] } else { let base = self . base . cast ( ) ; let len = self . size / mem :: size_of :: < T > ( ) ; unsafe { slice :: from_raw_parts_mut ( base , len ) } } }
Produces a mutable slice as a view into the contents of this buffer.
Produces a mutable slice as a view into the contents of this buffer .
self
example:
None
use neon::prelude::*;
None
fn modify_buffer(mut cx: functioncontext) -> jsresult<jsundefined> {
None
ok(cx.undefined())
None
}
None