pub struct RawCString { /* private fields */ }Expand description
A wrapper around the raw c_char pointer to a C string.
This is useful when you want to return a C string to JavaScript directly via NAPI-RS function without converting it to Rust string or performing any memory allocation.
The RawCString doesn’t implement FromNapiValue, so you can’t convert a JavaScript String to it.
Implementations§
Trait Implementations§
Source§impl Debug for RawCString
impl Debug for RawCString
Source§impl ToNapiValue for RawCString
impl ToNapiValue for RawCString
Source§unsafe fn to_napi_value(env: napi_env, val: Self) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: Self) -> Result<napi_value>
Safety Read more
fn into_unknown(self, env: &Env) -> Result<Unknown<'_>>
Auto Trait Implementations§
impl Freeze for RawCString
impl RefUnwindSafe for RawCString
impl !Send for RawCString
impl !Sync for RawCString
impl Unpin for RawCString
impl UnwindSafe for RawCString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more