Struct twitch_api::client::TowerService
source · pub struct TowerService<S, ReqBody>(pub S, _);
Available on crate features
tower
and client
only.Expand description
A wrapped tower service
Tuple Fields§
§0: S
Implementations§
source§impl<S, ReqBody> TowerService<S, ReqBody>
impl<S, ReqBody> TowerService<S, ReqBody>
sourcepub fn new(s: S) -> Selfwhere
S: Clone,
pub fn new(s: S) -> Selfwhere S: Clone,
Create a new wrapped tower service
Notes
Make sure your service stack can be cloned, one easy way to ensure this is to use tower::buffer
Trait Implementations§
source§impl<S, ReqBody, ResBody> Client for TowerService<S, ReqBody>where
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + Sync + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>>,
S::Future: Future<Output = Result<Response<ResBody>, S::Error>> + Send + 'static,
ResBody: HttpBody + Sync + Send + 'static,
ResBody::Error: Into<Box<dyn Error + Send + Sync>>,
ResBody::Data: Sync + Send,
ReqBody: From<Bytes> + Sync + Send + 'static,
impl<S, ReqBody, ResBody> Client for TowerService<S, ReqBody>where S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + Sync + 'static, S::Error: Into<Box<dyn Error + Send + Sync>>, S::Future: Future<Output = Result<Response<ResBody>, S::Error>> + Send + 'static, ResBody: HttpBody + Sync + Send + 'static, ResBody::Error: Into<Box<dyn Error + Send + Sync>>, ResBody::Data: Sync + Send, ReqBody: From<Bytes> + Sync + Send + 'static,
source§impl<S: Clone, ReqBody> Clone for TowerService<S, ReqBody>
impl<S: Clone, ReqBody> Clone for TowerService<S, ReqBody>
Auto Trait Implementations§
impl<S, ReqBody> RefUnwindSafe for TowerService<S, ReqBody>where S: RefUnwindSafe,
impl<S, ReqBody> Send for TowerService<S, ReqBody>where S: Send,
impl<S, ReqBody> Sync for TowerService<S, ReqBody>where S: Sync,
impl<S, ReqBody> Unpin for TowerService<S, ReqBody>where S: Unpin,
impl<S, ReqBody> UnwindSafe for TowerService<S, ReqBody>where S: 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