[−][src]Struct deno_core::plugin_api::ZeroCopyBuf
A ZeroCopyBuf encapsulates a slice that's been borrowed from a JavaScript ArrayBuffer object. JavaScript objects can normally be garbage collected, but the existence of a ZeroCopyBuf inhibits this until it is dropped. It behaves much like an Arc<u8>.
Cloning
Cloning a ZeroCopyBuf does not clone the contents of the buffer, it creates a new reference to that buffer.
To actually clone the contents of the buffer do
let copy = Vec::from(&*zero_copy_buf);
Implementations
impl ZeroCopyBuf
[src]
pub fn new<'s>(
scope: &mut HandleScope<'s>,
view: Local<'_, ArrayBufferView>
) -> Self
[src]
scope: &mut HandleScope<'s>,
view: Local<'_, ArrayBufferView>
) -> Self
Trait Implementations
impl AsMut<[u8]> for ZeroCopyBuf
[src]
impl AsRef<[u8]> for ZeroCopyBuf
[src]
impl Clone for ZeroCopyBuf
[src]
fn clone(&self) -> ZeroCopyBuf
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Deref for ZeroCopyBuf
[src]
impl DerefMut for ZeroCopyBuf
[src]
impl Send for ZeroCopyBuf
[src]
Auto Trait Implementations
impl RefUnwindSafe for ZeroCopyBuf
impl Sync for ZeroCopyBuf
impl Unpin for ZeroCopyBuf
impl UnwindSafe for ZeroCopyBuf
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,