v8

Struct ValueSerializer

Source
pub struct ValueSerializer<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ValueSerializer<'a>

ValueSerializer is a stack object used as entry-point for an owned and pinned heap object ValueSerializerHeap. The ’a lifetime is the lifetime of the ValueSerializerImpl implementation. The ’s lifetime is the lifetime of the HandleScope which is used to retrieve a Local<’s, Context> for the CallbackScopes

Source

pub fn new<D: ValueSerializerImpl + 'a>( scope: &mut HandleScope<'_>, value_serializer_impl: Box<D>, ) -> Self

Source§

impl<'a> ValueSerializer<'a>

Source

pub fn release(&self) -> Vec<u8>

Source

pub fn write_value( &self, context: Local<'_, Context>, value: Local<'_, Value>, ) -> Option<bool>

Trait Implementations§

Source§

impl<'a> ValueSerializerHelper for ValueSerializer<'a>

Source§

fn get_cxx_value_serializer(&self) -> &CxxValueSerializer

Source§

fn write_header(&self)

Source§

fn write_value( &self, context: Local<'_, Context>, value: Local<'_, Value>, ) -> Option<bool>

Source§

fn write_uint32(&self, value: u32)

Source§

fn write_uint64(&self, value: u64)

Source§

fn write_double(&self, value: f64)

Source§

fn write_raw_bytes(&self, source: &[u8])

Source§

fn transfer_array_buffer( &self, transfer_id: u32, array_buffer: Local<'_, ArrayBuffer>, )

Source§

fn set_treat_array_buffer_views_as_host_objects(&self, mode: bool)

Auto Trait Implementations§

§

impl<'a> Freeze for ValueSerializer<'a>

§

impl<'a> !RefUnwindSafe for ValueSerializer<'a>

§

impl<'a> !Send for ValueSerializer<'a>

§

impl<'a> !Sync for ValueSerializer<'a>

§

impl<'a> Unpin for ValueSerializer<'a>

§

impl<'a> !UnwindSafe for ValueSerializer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.