pub struct WithProto<'js, C>(pub C, pub Object<'js>);
Available on crate feature classes only.
Expand description

The prototype setting wrapper

This wrapper helps instantiate a class with desired prototype which is quite useful with constructors because allows class to be inheritable.

Tuple Fields§

§0: C§1: Object<'js>

Trait Implementations§

source§

impl<'js, C> IntoJs<'js> for WithProto<'js, C>where C: ClassDef + IntoJs<'js>,

source§

fn into_js(self, ctx: Ctx<'js>) -> Result<Value<'js>>

Auto Trait Implementations§

§

impl<'js, C> RefUnwindSafe for WithProto<'js, C>where C: RefUnwindSafe,

§

impl<'js, C> Send for WithProto<'js, C>where C: Send,

§

impl<'js, C> !Sync for WithProto<'js, C>

§

impl<'js, C> Unpin for WithProto<'js, C>where C: Unpin,

§

impl<'js, C> !UnwindSafe for WithProto<'js, C>

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<'js, T> AsProperty<'js, T> for Twhere T: IntoJs<'js>,

source§

fn config( self, ctx: Ctx<'js> ) -> Result<(i32, Value<'js>, Value<'js>, Value<'js>), Error>

Available on crate feature properties only.
Property configuration 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<'js, T> IntoInput<'js> for Twhere T: IntoJs<'js>,

source§

fn num_args(&self) -> usize

Get actual number of arguments
source§

fn into_input(self, input: &mut CallInput<'js>) -> Result<(), Error>

Put the value into inputs
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.
source§

impl<T> ParallelSend for T