Struct rquickjs::object::Accessor

source ·
pub struct Accessor<G, S> { /* private fields */ }
Available on crate feature properties only.
Expand description

The accessor descriptor of a readonly property

Implementations§

source§

impl<G, S> Accessor<G, S>

source

pub fn configurable(self) -> Accessor<G, S>

Make the property to be configurable

source

pub fn enumerable(self) -> Accessor<G, S>

Make the property to be enumerable

source§

impl<G> Accessor<G, ()>

source

pub fn new_get(get: G) -> Accessor<G, ()>

Create accessor from getter

source

pub fn set<S>(self, set: S) -> Accessor<G, S>

Add setter to accessor

source§

impl<S> Accessor<(), S>

source

pub fn new_set(set: S) -> Accessor<(), S>

Create accessor from setter

source

pub fn get<G>(self, get: G) -> Accessor<G, S>

Add getter to accessor

source§

impl<G, S> Accessor<G, S>

source

pub fn new(get: G, set: S) -> Accessor<G, S>

Create accessor from getter and setter

Trait Implementations§

source§

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

A property with setter only

source§

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

Property configuration Read more
source§

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

A property with getter only

source§

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

Property configuration Read more
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§

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

Property configuration Read more
source§

impl<G, S> Clone for Accessor<G, S>
where G: Clone, S: Clone,

source§

fn clone(&self) -> Accessor<G, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<G, S> Debug for Accessor<G, S>
where G: Debug, S: Debug,

source§

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

Formats the value using the given formatter. Read more
source§

impl<G> From<G> for Accessor<G, ()>

source§

fn from(get: G) -> Accessor<G, ()>

Converts to this type from the input type.
source§

impl<G, S> Copy for Accessor<G, S>
where G: Copy, S: Copy,

Auto Trait Implementations§

§

impl<G, S> Freeze for Accessor<G, S>
where G: Freeze, S: Freeze,

§

impl<G, S> RefUnwindSafe for Accessor<G, S>

§

impl<G, S> Send for Accessor<G, S>
where G: Send, S: Send,

§

impl<G, S> Sync for Accessor<G, S>
where G: Sync, S: Sync,

§

impl<G, S> Unpin for Accessor<G, S>
where G: Unpin, S: Unpin,

§

impl<G, S> UnwindSafe for Accessor<G, S>
where G: UnwindSafe, S: UnwindSafe,

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<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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
where T: Send,