pub struct ServiceHandler<Args, S>where
Args: FromRequest + 'static,
S: AsyncService<Input = Args> + 'static,
S::Output: Responder + 'static,
S::Error: ResponseError + 'static,{ /* private fields */ }Expand description
The highest level abstraction provided by this library. It is used to encapsulate underlying sod::Service
impls with an actix_web Handler that can be natively wired into an Actix actix_web::App.
Input tuples of FromRequest and outputs of Responder the responder trait make this directly compatible
with the native Actix request and response types.
See the this module’s documentation for details and examples.
Implementations§
Source§impl<Args, S> ServiceHandler<Args, S>where
Args: FromRequest + 'static,
S: AsyncService<Input = Args> + 'static,
S::Output: Responder + 'static,
S::Error: ResponseError + 'static,
impl<Args, S> ServiceHandler<Args, S>where
Args: FromRequest + 'static,
S: AsyncService<Input = Args> + 'static,
S::Output: Responder + 'static,
S::Error: ResponseError + 'static,
Sourcepub fn new(service: S) -> Self
pub fn new(service: S) -> Self
Encapsulate the given sod::AsyncService or sod::Service to be used as an actix_web::Handler
Trait Implementations§
Source§impl<Args, S> Clone for ServiceHandler<Args, S>where
Args: FromRequest + 'static,
S: AsyncService<Input = Args> + 'static,
S::Output: Responder + 'static,
S::Error: ResponseError + 'static,
impl<Args, S> Clone for ServiceHandler<Args, S>where
Args: FromRequest + 'static,
S: AsyncService<Input = Args> + 'static,
S::Output: Responder + 'static,
S::Error: ResponseError + 'static,
Source§impl<Args, S> Handler<Args> for ServiceHandler<Args, S>where
Args: FromRequest + Send + 'static,
S: AsyncService<Input = Args> + Send + Sync + 'static,
S::Output: Responder + Send + 'static,
S::Error: ResponseError + Send + 'static,
impl<Args, S> Handler<Args> for ServiceHandler<Args, S>where
Args: FromRequest + Send + 'static,
S: AsyncService<Input = Args> + Send + Sync + 'static,
S::Output: Responder + Send + 'static,
S::Error: ResponseError + Send + 'static,
Auto Trait Implementations§
impl<Args, S> Freeze for ServiceHandler<Args, S>
impl<Args, S> RefUnwindSafe for ServiceHandler<Args, S>where
S: RefUnwindSafe,
impl<Args, S> Send for ServiceHandler<Args, S>
impl<Args, S> Sync for ServiceHandler<Args, S>
impl<Args, S> Unpin for ServiceHandler<Args, S>
impl<Args, S> UnsafeUnpin for ServiceHandler<Args, S>
impl<Args, S> UnwindSafe for ServiceHandler<Args, S>where
S: RefUnwindSafe,
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