pub struct TestApp<S = ()> { /* private fields */ }
Expand description
Test application helper for testing request handlers.
Implementations
sourceimpl<S: 'static> TestApp<S>
impl<S: 'static> TestApp<S>
sourcepub fn handler<F, R>(&mut self, handler: F)where
F: Fn(&HttpRequest<S>) -> R + 'static,
R: Responder + 'static,
pub fn handler<F, R>(&mut self, handler: F)where
F: Fn(&HttpRequest<S>) -> R + 'static,
R: Responder + 'static,
Register handler for “/”
sourcepub fn middleware<T>(&mut self, mw: T) -> &mut TestApp<S>where
T: Middleware<S> + 'static,
pub fn middleware<T>(&mut self, mw: T) -> &mut TestApp<S>where
T: Middleware<S> + 'static,
Register middleware
Trait Implementations
sourceimpl<S: 'static> IntoHttpHandler for TestApp<S>
impl<S: 'static> IntoHttpHandler for TestApp<S>
type Handler = HttpApplication<S>
type Handler = HttpApplication<S>
The associated type which is result of conversion.
sourcefn into_handler(self) -> HttpApplication<S>
fn into_handler(self) -> HttpApplication<S>
Convert into
HttpHandler
object.Auto Trait Implementations
impl<S = ()> !RefUnwindSafe for TestApp<S>
impl<S = ()> !Send for TestApp<S>
impl<S = ()> !Sync for TestApp<S>
impl<S> Unpin for TestApp<S>where
S: Unpin,
impl<S = ()> !UnwindSafe for TestApp<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<I> IntoIterator for Iwhere
I: Iterator,
impl<I> IntoIterator for Iwhere
I: Iterator,
sourceimpl<I> IteratorRandom for Iwhere
I: Iterator,
impl<I> IteratorRandom for Iwhere
I: Iterator,
sourcefn choose<R>(self, rng: &mut R) -> Option<Self::Item>where
R: Rng + ?Sized,
fn choose<R>(self, rng: &mut R) -> Option<Self::Item>where
R: Rng + ?Sized,
Choose one element at random from the iterator. Read more
sourcefn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>where
R: Rng + ?Sized,
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>where
R: Rng + ?Sized,
Choose one element at random from the iterator. Read more
sourceimpl<I> IteratorRandom for Iwhere
I: Iterator,
impl<I> IteratorRandom for Iwhere
I: Iterator,
sourcefn choose<R>(self, rng: &mut R) -> Option<Self::Item>where
R: Rng + ?Sized,
fn choose<R>(self, rng: &mut R) -> Option<Self::Item>where
R: Rng + ?Sized,
Choose one element at random from the iterator. If you have a slice,
it’s significantly faster to call the
choose
or choose_mut
functions using the slice instead. Read more