pub struct FakeHandler(/* private fields */);Expand description
A fake for HttpFake::with.
Status numbers, strings, JSON values, FakeResponses, Sequences, and closures that
receive the Request convert into it.
Trait Implementations§
Source§impl Clone for FakeHandler
impl Clone for FakeHandler
Source§fn clone(&self) -> FakeHandler
fn clone(&self) -> FakeHandler
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 Debug for FakeHandler
impl Debug for FakeHandler
Source§impl From<&str> for FakeHandler
A 200 with this body.
impl From<&str> for FakeHandler
A 200 with this body.
Source§fn from(body: &str) -> FakeHandler
fn from(body: &str) -> FakeHandler
Converts to this type from the input type.
Source§impl<F, R> From<F> for FakeHandler
A closure that receives the request and returns a fake.
impl<F, R> From<F> for FakeHandler
A closure that receives the request and returns a fake.
Source§fn from(respond: F) -> FakeHandler
fn from(respond: F) -> FakeHandler
Converts to this type from the input type.
Source§impl From<FakeResponse> for FakeHandler
impl From<FakeResponse> for FakeHandler
Source§fn from(response: FakeResponse) -> FakeHandler
fn from(response: FakeResponse) -> FakeHandler
Converts to this type from the input type.
Source§impl From<Sequence> for FakeHandler
impl From<Sequence> for FakeHandler
Source§fn from(sequence: Sequence) -> FakeHandler
fn from(sequence: Sequence) -> FakeHandler
Converts to this type from the input type.
Source§impl From<StatusCode> for FakeHandler
An empty response with this status.
impl From<StatusCode> for FakeHandler
An empty response with this status.
Source§fn from(status: StatusCode) -> FakeHandler
fn from(status: StatusCode) -> FakeHandler
Converts to this type from the input type.
Source§impl From<String> for FakeHandler
A 200 with this body.
impl From<String> for FakeHandler
A 200 with this body.
Source§fn from(body: String) -> FakeHandler
fn from(body: String) -> FakeHandler
Converts to this type from the input type.
Source§impl From<Value> for FakeHandler
A 200 with this JSON body.
impl From<Value> for FakeHandler
A 200 with this JSON body.
Source§fn from(body: Value) -> FakeHandler
fn from(body: Value) -> FakeHandler
Converts to this type from the input type.
Source§impl From<u16> for FakeHandler
An empty response with this status.
impl From<u16> for FakeHandler
An empty response with this status.
Source§fn from(status: u16) -> FakeHandler
fn from(status: u16) -> FakeHandler
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for FakeHandler
impl !RefUnwindSafe for FakeHandler
impl !UnwindSafe for FakeHandler
impl Forget for FakeHandler
impl Move for FakeHandler
impl Send for FakeHandler
impl Sync for FakeHandler
impl Unpin for FakeHandler
impl UnsafeUnpin for FakeHandlerwhere
NonZeroU16Inner: UnsafeUnpin,
*const [Pos] is !null: UnsafeUnpin,
PhantomData<[Pos]>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Bucket<HeaderValue>>: UnsafeUnpin,
PhantomData<ExtraValue<HeaderValue>>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
*const ArcInner<Mutex<Sequence>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Sequence>>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&Request) -> FakeHandler + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&Request) -> FakeHandler + Sync + Send>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreCreates a shared type from an unshared type.