Struct Reconnect

pub struct Reconnect<M, Target>
where
    M: Service<Target>, { /* private fields */ }

Reconnect to failed services.

Implementations

impl<M, Target> Reconnect<M, Target> where M: Service<Target>,

const fn new(mk_service: M, target: Target) -> Self

Lazily connect and reconnect to a Service.

const fn with_connection(init_conn: M::Response, mk_service: M, target: Target) -> Self

Reconnect to a already connected Service.

Trait Implementations

impl<M, Target> Debug for Reconnect<M, Target> where M: Service<Target> + Debug, M::Future: Debug, M::Response: Debug, Target: Debug,

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

impl<M, Target, S, Request> Service<Request> for Reconnect<M, Target> where M: Service<Target, Response = S>, S: Service<Request>, M::Future: Unpin, BoxError: From<M::Error> + From<S::Error>, Target: Clone,

type Response = <S as Service<Request>>::Response;
type Error = Box<dyn Error + Sync + Send>;
type Future = ResponseFuture<<S as Service<Request>>::Future, <M as Service<Target>>::Error>;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn call(&mut self, request: Request) -> Self::Future

Auto Trait Implementations

impl<M, Target> Freeze for Reconnect<M, Target> where M: Freeze, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: Freeze, Target: Freeze, Option<<M as Service<Target>>::Error>: Freeze,

impl<M, Target> RefUnwindSafe for Reconnect<M, Target> where M: RefUnwindSafe, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: RefUnwindSafe, Target: RefUnwindSafe, Option<<M as Service<Target>>::Error>: RefUnwindSafe,

impl<M, Target> Send for Reconnect<M, Target> where M: Send, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: Send, Target: Send, Option<<M as Service<Target>>::Error>: Send,

impl<M, Target> Sync for Reconnect<M, Target> where M: Sync, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: Sync, Target: Sync, Option<<M as Service<Target>>::Error>: Sync,

impl<M, Target> Unpin for Reconnect<M, Target> where M: Unpin, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: Unpin, Target: Unpin, Option<<M as Service<Target>>::Error>: Unpin,

impl<M, Target> UnsafeUnpin for Reconnect<M, Target> where M: UnsafeUnpin, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: UnsafeUnpin, Target: UnsafeUnpin, Option<<M as Service<Target>>::Error>: UnsafeUnpin,

impl<M, Target> UnwindSafe for Reconnect<M, Target> where M: UnwindSafe, State<<M as Service<Target>>::Future, <M as Service<Target>>::Response>: UnwindSafe, Target: UnwindSafe, Option<<M as Service<Target>>::Error>: UnwindSafe,

Blanket Implementations

impl<C, Target> MakeConnection<Target> for Reconnect<M, Target> where C: Service<Target>, <C as Service<Target>>::Response: AsyncRead + AsyncWrite,

type Connection = <C as Service<Target>>::Response;
type Error = <C as Service<Target>>::Error;
type Future = <C as Service<Target>>::Future;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <C as MakeConnection<Target>>::Error>>
fn make_connection(&mut self, target: Target) -> <C as MakeConnection<Target>>::Future

impl<M, S, Target, Request> MakeService<Target, Request> for Reconnect<M, Target> where M: Service<Target, Response = S>, S: Service<Request>,

type Response = <S as Service<Request>>::Response;
type Error = <S as Service<Request>>::Error;
type Service = S;
type MakeError = <M as Service<Target>>::Error;
type Future = <M as Service<Target>>::Future;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>
fn make_service(&mut self, target: Target) -> <M as MakeService<Target, Request>>::Future

impl<T> Any for Reconnect<M, Target> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Reconnect<M, Target> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Reconnect<M, Target> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Reconnect<M, Target>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Reconnect<M, Target>

impl<T> WithSubscriber for Reconnect<M, Target>

impl<T, Request> ServiceExt<Request> for Reconnect<M, Target> where T: Service<Request> + ?Sized,

impl<T, U> Into<U> for Reconnect<M, Target> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Reconnect<M, Target> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Reconnect<M, Target> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>