Struct Shared
struct Shared<S> { ... }
A MakeService that produces services by cloning an inner service.
Example
# use ;
# use Pin;
# use Infallible;
use ;
use Buffer;
use Service;
use ;
// An example connection type
// An example request type
// An example response type
// Some service that doesn't implement `Clone`
;
// Example function that runs a service by accepting new connections and using
// `Make` to create new services that might be bound to the connection.
//
// This is similar to what you might find in hyper.
async
# async ;
Implementations
impl<S> Shared<S>
const fn new(service: S) -> SelfCreate a new
Sharedfrom a service.
impl<M, S, Target, Request> MakeService for Shared<S>
fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>fn make_service(self: &mut Self, target: Target) -> <M as MakeService<Target, Request>>::Future
impl<S> Freeze for Shared<S>
impl<S> RefUnwindSafe for Shared<S>
impl<S> Send for Shared<S>
impl<S> Sync for Shared<S>
impl<S> Unpin for Shared<S>
impl<S> UnsafeUnpin for Shared<S>
impl<S> UnwindSafe for Shared<S>
impl<S, T> Service for Shared<S>
fn poll_ready(self: &mut Self, _cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>fn call(self: &mut Self, _target: T) -> <Self as >::Future
impl<S: $crate::clone::Clone> Clone for Shared<S>
fn clone(self: &Self) -> Shared<S>
impl<S: $crate::fmt::Debug> Debug for Shared<S>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<S: $crate::marker::Copy> Copy for Shared<S>
impl<T> Any for Shared<S>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Shared<S>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Shared<S>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Shared<S>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Shared<S>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Shared<S>
impl<T> ToOwned for Shared<S>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> WithSubscriber for Shared<S>
impl<T, Request> ServiceExt for Shared<S>
impl<T, U> Into for Shared<S>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Shared<S>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Shared<S>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>