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
sourceimpl<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> !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
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