Struct v8::ReturnValue

source ·
#[repr(C)]
pub struct ReturnValue<'cb>(/* private fields */);

Implementations§

source§

impl<'cb> ReturnValue<'cb>

In V8 ReturnValue<> has a type parameter, but it turns out that in most of the APIs it’s ReturnValue and for our purposes we currently don’t need other types. So for now it’s a simplified version.

source

pub fn from_function_callback_info(info: &'cb FunctionCallbackInfo) -> Self

source

pub fn from_property_callback_info(info: &'cb PropertyCallbackInfo) -> Self

source

pub fn set(&mut self, value: Local<'_, Value>)

source

pub fn set_bool(&mut self, value: bool)

source

pub fn set_int32(&mut self, value: i32)

source

pub fn set_uint32(&mut self, value: u32)

source

pub fn set_double(&mut self, value: f64)

source

pub fn set_null(&mut self)

source

pub fn set_undefined(&mut self)

source

pub fn set_empty_string(&mut self)

source

pub fn get<'s>(&self, scope: &mut HandleScope<'s>) -> Local<'s, Value>

Getter. Creates a new Local<> so it comes with a certain performance hit. If the ReturnValue was not yet set, this will return the undefined value.

Trait Implementations§

source§

impl<'cb> Debug for ReturnValue<'cb>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'cb> RefUnwindSafe for ReturnValue<'cb>

§

impl<'cb> !Send for ReturnValue<'cb>

§

impl<'cb> !Sync for ReturnValue<'cb>

§

impl<'cb> Unpin for ReturnValue<'cb>

§

impl<'cb> UnwindSafe for ReturnValue<'cb>

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.