Trait rquickjs_core::object::AsProperty

source ·
pub trait AsProperty<'js, P> {
    // Required method
    fn config(
        self,
        ctx: &Ctx<'js>
    ) -> Result<(PropertyFlags, Value<'js>, Value<'js>, Value<'js>)>;
}
Expand description

The property interface

Required Methods§

source

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

Property configuration

Returns the tuple which includes the following:

  • flags
  • value or undefined when no value is here
  • getter or undefined if the property hasn’t getter
  • setter or undefined if the property hasn’t setter

Implementors§

source§

impl<'js, G, GA> AsProperty<'js, (GA, (), ())> for Accessor<G, ()>
where G: IntoJsFunc<'js, GA> + 'js,

A property with getter only

source§

impl<'js, G, GA, S, SA> AsProperty<'js, (GA, SA)> for Accessor<G, S>
where G: IntoJsFunc<'js, GA> + 'js, S: IntoJsFunc<'js, SA> + 'js,

A property with getter and setter

source§

impl<'js, S, SA> AsProperty<'js, ((), (), SA)> for Accessor<(), S>
where S: IntoJsFunc<'js, SA> + 'js,

A property with setter only

source§

impl<'js, T> AsProperty<'js, T> for Property<T>
where T: IntoJs<'js>,

source§

impl<'js, T> AsProperty<'js, T> for T
where T: IntoJs<'js>,