pub struct SpawnService<T: HttpService + Clone> { /* private fields */ }Expand description
Wraps a provided HttpService and runs it on a separate tokio runtime
See example on SpawnedReqwestConnector
Implementations§
Source§impl<T: HttpService + Clone> SpawnService<T>
impl<T: HttpService + Clone> SpawnService<T>
Sourcepub fn new(inner: T, runtime: Handle) -> Self
pub fn new(inner: T, runtime: Handle) -> Self
Creates a new SpawnService from the provided
Trait Implementations§
Source§impl<T: Debug + HttpService + Clone> Debug for SpawnService<T>
impl<T: Debug + HttpService + Clone> Debug for SpawnService<T>
Source§impl<T: HttpService + Clone> HttpService for SpawnService<T>
impl<T: HttpService + Clone> HttpService for SpawnService<T>
Source§fn call<'life0, 'async_trait>(
&'life0 self,
req: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
req: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform
HttpRequest returning HttpResponseAuto Trait Implementations§
impl<T> Freeze for SpawnService<T>where
T: Freeze,
impl<T> RefUnwindSafe for SpawnService<T>where
T: RefUnwindSafe,
impl<T> Send for SpawnService<T>
impl<T> Sync for SpawnService<T>
impl<T> Unpin for SpawnService<T>where
T: Unpin,
impl<T> UnsafeUnpin for SpawnService<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SpawnService<T>where
T: UnwindSafe,
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> 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 more