Struct worker::DynamicDispatcher
source · pub struct DynamicDispatcher(/* private fields */);
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§
source§impl AsRef<JsValue> for DynamicDispatcher
impl AsRef<JsValue> for DynamicDispatcher
source§impl Clone for DynamicDispatcher
impl Clone for DynamicDispatcher
source§fn clone(&self) -> DynamicDispatcher
fn clone(&self) -> DynamicDispatcher
Returns a copy 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 Debug for DynamicDispatcher
impl Debug for DynamicDispatcher
source§impl EnvBinding for DynamicDispatcher
impl EnvBinding for DynamicDispatcher
source§impl From<DynamicDispatcher> for JsValue
impl From<DynamicDispatcher> for JsValue
source§fn from(sec: DynamicDispatcher) -> Self
fn from(sec: DynamicDispatcher) -> Self
Converts to this type from the input type.
source§impl From<JsValue> for DynamicDispatcher
impl From<JsValue> for DynamicDispatcher
source§impl JsCast for DynamicDispatcher
impl JsCast for DynamicDispatcher
source§fn 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 moresource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
source§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
Test whether this JS value has a type
T
. Read moresource§fn 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 moresource§fn 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 moresource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Performs a zero-cost unchecked cast into the specified type. Read more
source§fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Performs a zero-cost unchecked cast into a reference to the specified
type. Read more
Auto Trait Implementations§
impl Freeze for DynamicDispatcher
impl RefUnwindSafe for DynamicDispatcher
impl !Send for DynamicDispatcher
impl !Sync for DynamicDispatcher
impl Unpin for DynamicDispatcher
impl UnwindSafe for DynamicDispatcher
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
Mutably borrows from an owned value. Read more