Struct worker::DynamicDispatcher
source · [−]pub struct DynamicDispatcher(_);
Expand description
A binding for dispatching events to Workers inside of a dispatch namespace by their name. This allows for your worker to directly invoke many workers by name instead of having multiple service worker bindings.
Example:
let dispatcher = env.dynamic_dispatcher("DISPATCHER")?;
let fetcher = dispatcher.get("namespaced-worker-name")?;
let resp = fetcher.fetch_request(req).await?;
Implementations
Trait Implementations
sourceimpl AsRef<JsValue> for DynamicDispatcher
impl AsRef<JsValue> for DynamicDispatcher
sourceimpl Clone for DynamicDispatcher
impl Clone for DynamicDispatcher
sourcefn clone(&self) -> DynamicDispatcher
fn clone(&self) -> DynamicDispatcher
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DynamicDispatcher
impl Debug for DynamicDispatcher
sourceimpl From<DynamicDispatcher> for JsValue
impl From<DynamicDispatcher> for JsValue
sourcefn from(sec: DynamicDispatcher) -> Self
fn from(sec: DynamicDispatcher) -> Self
Converts to this type from the input type.
sourceimpl From<JsValue> for DynamicDispatcher
impl From<JsValue> for DynamicDispatcher
sourceimpl JsCast for DynamicDispatcher
impl JsCast for DynamicDispatcher
sourcefn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
Performs a dynamic instanceof
check to see whether the JsValue
provided is an instance of this type. Read more
sourcefn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Performs a zero-cost unchecked conversion from a JsValue
into an
instance of Self
Read more
sourcefn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
Performs a zero-cost unchecked conversion from a &JsValue
into an
instance of &Self
. Read more
sourcefn has_type<T>(&self) -> bool where
T: JsCast,
fn has_type<T>(&self) -> bool where
T: JsCast,
Test whether this JS value has a type T
. Read more
sourcefn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self> where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the
target type T
. Read more
sourcefn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T> where
T: JsCast,
Performs a dynamic cast (checked at runtime) of this value into the
target type T
. Read more
sourcefn unchecked_into<T>(self) -> T where
T: JsCast,
fn unchecked_into<T>(self) -> T where
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
sourcefn unchecked_ref<T>(&self) -> &T where
T: JsCast,
fn unchecked_ref<T>(&self) -> &T where
T: JsCast,
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
sourcefn is_instance_of<T>(&self) -> bool where
T: JsCast,
fn is_instance_of<T>(&self) -> bool where
T: JsCast,
Test whether this JS value is an instance of the type T
. Read more
sourcefn is_type_of(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
Performs a dynamic check to see whether the JsValue
provided
is a value of this type. Read more
Auto Trait Implementations
impl RefUnwindSafe for DynamicDispatcher
impl !Send for DynamicDispatcher
impl !Sync for DynamicDispatcher
impl Unpin for DynamicDispatcher
impl UnwindSafe for DynamicDispatcher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more