Struct tsukuyomi_server::local::LocalServer
source · pub struct LocalServer<S> { /* private fields */ }Expand description
A local server which emulates an HTTP service without using the low-level transport.
The value of this struct conttains an instance of NewHttpService
and a Tokio runtime.
Implementations§
source§impl<S> LocalServer<S>where
S: NewService + Send + 'static,
S::Request: HttpRequest,
S::Response: HttpResponse,
S::Error: Into<CritError>,
S::Future: Send + 'static,
S::Service: Send + 'static,
S::InitError: Send + 'static,
impl<S> LocalServer<S>where
S: NewService + Send + 'static,
S::Request: HttpRequest,
S::Response: HttpResponse,
S::Error: Into<CritError>,
S::Future: Send + 'static,
S::Service: Send + 'static,
S::InitError: Send + 'static,
sourcepub fn new(new_service: S) -> Result<LocalServer<S>>
pub fn new(new_service: S) -> Result<LocalServer<S>>
Creates a new instance of LocalServer from a NewHttpService.
This function will return an error if the construction of the runtime is failed.
Trait Implementations§
Auto Trait Implementations§
impl<S> !Freeze for LocalServer<S>
impl<S> !RefUnwindSafe for LocalServer<S>
impl<S> Send for LocalServer<S>where
S: Send,
impl<S> Sync for LocalServer<S>where
S: Sync,
impl<S> Unpin for LocalServer<S>where
S: Unpin,
impl<S> !UnwindSafe for LocalServer<S>
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
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 more