#[repr(transparent)]pub struct JsBuffer(_);
Expand description
The Node Buffer
type.
Implementations
sourceimpl JsBuffer
impl JsBuffer
Trait Implementations
sourceimpl Object for JsBuffer
impl Object for JsBuffer
sourcefn get_opt<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Option<Handle<'a, V>>>
fn get_opt<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Option<Handle<'a, V>>>
Gets a property from a JavaScript object that may be undefined
and
attempts to downcast the value if it existed. Read more
sourcefn get_value<'a, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, JsValue>>
fn get_value<'a, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, JsValue>>
sourcefn get<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, V>>
fn get<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, V>>
Gets a property from a JavaScript object and attempts to downcast as a specific type.
Equivalent to calling obj.get(&mut cx)?.downcast_or_throw(&mut cx)
. Read more
sourcefn get_own_property_names<'a, C: Context<'a>>(
&self,
cx: &mut C
) -> JsResult<'a, JsArray>
fn get_own_property_names<'a, C: Context<'a>>(
&self,
cx: &mut C
) -> JsResult<'a, JsArray>
This is supported on crate feature
napi-6
only.fn set<'a, C: Context<'a>, K: PropertyKey, W: Value>(
&self,
cx: &mut C,
key: K,
val: Handle<'_, W>
) -> NeonResult<bool>
fn root<'a, C: Context<'a>>(&self, cx: &mut C) -> Root<Self>
sourceimpl TypedArray for JsBuffer
impl TypedArray for JsBuffer
type Item = u8
sourcefn as_slice<'a: 'b, 'b, C>(&'b self, cx: &'b C) -> &'b [Self::Item] where
C: Context<'a>,
fn as_slice<'a: 'b, 'b, C>(&'b self, cx: &'b C) -> &'b [Self::Item] where
C: Context<'a>,
Statically checked immutable borrow of binary data. Read more
sourcefn as_mut_slice<'a: 'b, 'b, C>(
&'b mut self,
cx: &'b mut C
) -> &'b mut [Self::Item] where
C: Context<'a>,
fn as_mut_slice<'a: 'b, 'b, C>(
&'b mut self,
cx: &'b mut C
) -> &'b mut [Self::Item] where
C: Context<'a>,
Statically checked mutable borrow of binary data. Read more
sourcefn try_borrow<'a: 'b, 'b, C>(
&self,
lock: &'b Lock<'b, C>
) -> Result<Ref<'b, Self::Item>, BorrowError> where
C: Context<'a>,
fn try_borrow<'a: 'b, 'b, C>(
&self,
lock: &'b Lock<'b, C>
) -> Result<Ref<'b, Self::Item>, BorrowError> where
C: Context<'a>,
Dynamically checked immutable borrow of binary data, returning an error if the the borrow would overlap with a mutable borrow. Read more
sourcefn try_borrow_mut<'a: 'b, 'b, C>(
&mut self,
lock: &'b Lock<'b, C>
) -> Result<RefMut<'b, Self::Item>, BorrowError> where
C: Context<'a>,
fn try_borrow_mut<'a: 'b, 'b, C>(
&mut self,
lock: &'b Lock<'b, C>
) -> Result<RefMut<'b, Self::Item>, BorrowError> where
C: Context<'a>,
Dynamically checked mutable borrow of binary data, returning an error if the the borrow would overlap with an active borrow. Read more
Auto Trait Implementations
impl RefUnwindSafe for JsBuffer
impl !Send for JsBuffer
impl !Sync for JsBuffer
impl Unpin for JsBuffer
impl UnwindSafe for JsBuffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more