pub struct ProxyHandler<'js>(/* private fields */);Expand description
Rust representation of a JavaScript proxy handler.
Implementations§
Source§impl<'js> ProxyHandler<'js>
impl<'js> ProxyHandler<'js>
Sourcepub fn from_object(object: Object<'js>) -> Result<Self>
pub fn from_object(object: Object<'js>) -> Result<Self>
Create a new proxy handler from a existing object
Sourcepub fn set_getter<F, V>(&self, get: F) -> Result<()>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, ProxyReceiver<'js>) -> Result<V> + 'js,
V: IntoJs<'js> + 'js,
pub fn set_getter<F, V>(&self, get: F) -> Result<()>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, ProxyReceiver<'js>) -> Result<V> + 'js,
V: IntoJs<'js> + 'js,
Set the getter function for the proxy handler
Sourcepub fn with_getter<F, V>(self, get: F) -> Result<Self>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, ProxyReceiver<'js>) -> Result<V> + 'js,
V: IntoJs<'js> + 'js,
pub fn with_getter<F, V>(self, get: F) -> Result<Self>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, ProxyReceiver<'js>) -> Result<V> + 'js,
V: IntoJs<'js> + 'js,
Set the getter function for the proxy handler
Sourcepub fn set_setter<F>(&self, set: F) -> Result<()>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, Value<'js>, ProxyReceiver<'js>) -> Result<bool> + 'js,
pub fn set_setter<F>(&self, set: F) -> Result<()>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, Value<'js>, ProxyReceiver<'js>) -> Result<bool> + 'js,
Set the setter function for the proxy handler
Sourcepub fn with_setter<F>(self, set: F) -> Result<Self>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, Value<'js>, ProxyReceiver<'js>) -> Result<bool> + 'js,
pub fn with_setter<F>(self, set: F) -> Result<Self>where
F: Fn(ProxyTarget<'js>, ProxyProperty<'js>, Value<'js>, ProxyReceiver<'js>) -> Result<bool> + 'js,
Set the setter function for the proxy handler
Sourcepub fn set_delete<F>(&self, delete: F) -> Result<()>
pub fn set_delete<F>(&self, delete: F) -> Result<()>
Set the delete function for the proxy handler
Sourcepub fn with_delete<F>(self, delete: F) -> Result<Self>
pub fn with_delete<F>(self, delete: F) -> Result<Self>
Set the delete function for the proxy handler
Trait Implementations§
Source§impl<'js> Clone for ProxyHandler<'js>
impl<'js> Clone for ProxyHandler<'js>
Source§fn clone(&self) -> ProxyHandler<'js>
fn clone(&self) -> ProxyHandler<'js>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'js> Debug for ProxyHandler<'js>
impl<'js> Debug for ProxyHandler<'js>
Source§impl<'js> Hash for ProxyHandler<'js>
impl<'js> Hash for ProxyHandler<'js>
Source§impl<'js> IntoJs<'js> for ProxyHandler<'js>
impl<'js> IntoJs<'js> for ProxyHandler<'js>
Source§impl<'js> PartialEq for ProxyHandler<'js>
impl<'js> PartialEq for ProxyHandler<'js>
impl<'js> Eq for ProxyHandler<'js>
impl<'js> StructuralPartialEq for ProxyHandler<'js>
Auto Trait Implementations§
impl<'js> Freeze for ProxyHandler<'js>
impl<'js> RefUnwindSafe for ProxyHandler<'js>
impl<'js> !Send for ProxyHandler<'js>
impl<'js> !Sync for ProxyHandler<'js>
impl<'js> Unpin for ProxyHandler<'js>
impl<'js> !UnwindSafe for ProxyHandler<'js>
Blanket Implementations§
Source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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