Struct LoadShed

pub struct LoadShed<S> { /* private fields */ }

A Service that sheds load when the inner service isn't ready.

Implementations

impl<S> LoadShed<S>

const fn new(inner: S) -> Self

Wraps a service in LoadShed middleware.

Trait Implementations

impl<S, Req> Service<Req> for LoadShed<S> where S: Service<Req>, S::Error: Into<BoxError>,

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

impl<S: Clone> Clone for LoadShed<S>

fn clone(&self) -> Self

impl<S: Debug> Debug for LoadShed<S>

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

Auto Trait Implementations

impl<S> Freeze for LoadShed<S> where S: Freeze,

impl<S> RefUnwindSafe for LoadShed<S> where S: RefUnwindSafe,

impl<S> Send for LoadShed<S> where S: Send,

impl<S> Sync for LoadShed<S> where S: Sync,

impl<S> Unpin for LoadShed<S> where S: Unpin,

impl<S> UnsafeUnpin for LoadShed<S> where S: UnsafeUnpin,

impl<S> UnwindSafe for LoadShed<S> where S: UnwindSafe,

Blanket Implementations

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

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

impl<T> Any for LoadShed<S> where T: 'static + ?Sized,

impl<T> Borrow<T> for LoadShed<S> where T: ?Sized,

impl<T> BorrowMut<T> for LoadShed<S> where T: ?Sized,

impl<T> CloneToUninit for LoadShed<S> where T: Clone,

impl<T> From<T> for LoadShed<S>

impl<T> Instrument for LoadShed<S>

impl<T> ToOwned for LoadShed<S> where T: Clone,

impl<T> WithSubscriber for LoadShed<S>

impl<T, Request> ServiceExt<Request> for LoadShed<S> where T: Service<Request> + ?Sized,

impl<T, U> Into<U> for LoadShed<S> where U: From<T>,

impl<T, U> TryFrom<U> for LoadShed<S> where U: Into<T>,

impl<T, U> TryInto<U> for LoadShed<S> where U: TryFrom<T>,