Struct boa_engine::object::builtins::JsProxyBuilder
source · pub struct JsProxyBuilder { /* private fields */ }
Expand description
Implementations§
source§impl JsProxyBuilder
impl JsProxyBuilder
sourcepub fn new(target: JsObject) -> Self
pub fn new(target: JsObject) -> Self
Create a new ProxyBuilder
with every trap set to undefined
.
sourcepub fn apply(self, apply: NativeFunctionPointer) -> Self
pub fn apply(self, apply: NativeFunctionPointer) -> Self
Set the apply
proxy trap to the specified native function.
More information:
§Note
If the target
object is not a function, then apply
will be ignored
when trying to call the proxy, which will throw a type error.
sourcepub fn construct(self, construct: NativeFunctionPointer) -> Self
pub fn construct(self, construct: NativeFunctionPointer) -> Self
Set the construct
proxy trap to the specified native function.
More information:
§Note
If the target
object is not a constructor, then construct
will be ignored
when trying to construct an object using the proxy, which will throw a type error.
sourcepub fn define_property(self, define_property: NativeFunctionPointer) -> Self
pub fn define_property(self, define_property: NativeFunctionPointer) -> Self
Set the defineProperty
proxy trap to the specified native function.
More information:
sourcepub fn delete_property(self, delete_property: NativeFunctionPointer) -> Self
pub fn delete_property(self, delete_property: NativeFunctionPointer) -> Self
Set the deleteProperty
proxy trap to the specified native function.
More information:
sourcepub fn get(self, get: NativeFunctionPointer) -> Self
pub fn get(self, get: NativeFunctionPointer) -> Self
sourcepub fn get_own_property_descriptor(
self,
get_own_property_descriptor: NativeFunctionPointer
) -> Self
pub fn get_own_property_descriptor( self, get_own_property_descriptor: NativeFunctionPointer ) -> Self
Set the getOwnPropertyDescriptor
proxy trap to the specified native function.
More information:
sourcepub fn get_prototype_of(self, get_prototype_of: NativeFunctionPointer) -> Self
pub fn get_prototype_of(self, get_prototype_of: NativeFunctionPointer) -> Self
Set the getPrototypeOf
proxy trap to the specified native function.
More information:
sourcepub fn has(self, has: NativeFunctionPointer) -> Self
pub fn has(self, has: NativeFunctionPointer) -> Self
sourcepub fn is_extensible(self, is_extensible: NativeFunctionPointer) -> Self
pub fn is_extensible(self, is_extensible: NativeFunctionPointer) -> Self
Set the isExtensible
proxy trap to the specified native function.
More information:
sourcepub fn own_keys(self, own_keys: NativeFunctionPointer) -> Self
pub fn own_keys(self, own_keys: NativeFunctionPointer) -> Self
sourcepub fn prevent_extensions(
self,
prevent_extensions: NativeFunctionPointer
) -> Self
pub fn prevent_extensions( self, prevent_extensions: NativeFunctionPointer ) -> Self
Set the preventExtensions
proxy trap to the specified native function.
More information:
sourcepub fn set(self, set: NativeFunctionPointer) -> Self
pub fn set(self, set: NativeFunctionPointer) -> Self
sourcepub fn set_prototype_of(self, set_prototype_of: NativeFunctionPointer) -> Self
pub fn set_prototype_of(self, set_prototype_of: NativeFunctionPointer) -> Self
Set the setPrototypeOf
proxy trap to the specified native function.
More information:
sourcepub fn build_revocable(self, context: &mut Context) -> JsRevocableProxy
pub fn build_revocable(self, context: &mut Context) -> JsRevocableProxy
Builds a JsObject
of kind Proxy
and a JsFunction
that, when
called, disables the proxy of the object.
Equivalent to the Proxy.revocable ( target, handler )
static method,
but returns a JsObject
for the proxy and a JsFunction
for the
revoker in case there’s a need to manipulate the returned objects
inside Rust code.
Trait Implementations§
source§impl Clone for JsProxyBuilder
impl Clone for JsProxyBuilder
source§fn clone(&self) -> JsProxyBuilder
fn clone(&self) -> JsProxyBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for JsProxyBuilder
impl !Send for JsProxyBuilder
impl !Sync for JsProxyBuilder
impl Unpin for JsProxyBuilder
impl !UnwindSafe for JsProxyBuilder
Blanket Implementations§
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
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.