pub struct FakeDispatcher { /* private fields */ }Expand description
An in-process Dispatcher that answers from an
axum Router, so a
module can be exercised through a sidecar mount without a network or a
second Worker (ADR 0009). The conformance kit uses it to run the same
assertions against both mounts (#64).
Also the failure fixture: unbound has no
binding at all, and failing accepts the
binding and then refuses to answer.
Implementations§
Trait Implementations§
Source§impl Clone for FakeDispatcher
impl Clone for FakeDispatcher
Source§fn clone(&self) -> FakeDispatcher
fn clone(&self) -> FakeDispatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Dispatcher for FakeDispatcher
impl Dispatcher for FakeDispatcher
Source§fn has(&self, binding: &str) -> bool
fn has(&self, binding: &str) -> bool
Whether a binding of this name exists. Cheap; called per request before
dispatching so a missing binding degrades one prefix rather than
surfacing as a transport error.
Source§fn dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
binding: &'life1 str,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, DispatchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
binding: &'life1 str,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, DispatchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Forward
request to the bound Worker and return its response
unaltered. Implementations must not retry: a sidecar call is inside
the caller’s request, and a retry would double any side effect.Auto Trait Implementations§
impl Freeze for FakeDispatcher
impl RefUnwindSafe for FakeDispatcher
impl Send for FakeDispatcher
impl Sync for FakeDispatcher
impl Unpin for FakeDispatcher
impl UnsafeUnpin for FakeDispatcher
impl UnwindSafe for FakeDispatcher
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