Struct v8::ValueSerializer

source ·
pub struct ValueSerializer<'a, 's> { /* private fields */ }

Implementations§

source§

impl<'a, 's> ValueSerializer<'a, 's>

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<'s>, value_serializer_impl: Box<D> ) -> Self

source§

impl<'a, 's> ValueSerializer<'a, 's>

source

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

source

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

Trait Implementations§

source§

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

source§

fn get_cxx_value_serializer(&mut self) -> &mut CxxValueSerializer

source§

fn write_header(&mut self)

source§

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

source§

fn write_uint32(&mut self, value: u32)

source§

fn write_uint64(&mut self, value: u64)

source§

fn write_double(&mut self, value: f64)

source§

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

source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.