#[non_exhaustive]
pub enum TimeoutServiceFuture<F> {
Timeout {
future: Timeout<F, Sleep>,
kind: &'static str,
duration: Duration,
},
NoTimeout {
future: F,
},
}
Expand description
A future generated by a TimeoutService
that may or may not have a timeout depending on
whether or not one was set. Because TimeoutService
can be used at multiple levels of the
service stack, a kind
can be set so that when a timeout occurs, you can know which kind of
timeout it was.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Timeout
A wrapper around an inner future that will output an SdkError
if it runs longer than
the given duration
NoTimeout
A thin wrapper around an inner future that will never time out
Implementations
sourceimpl<F> TimeoutServiceFuture<F>
impl<F> TimeoutServiceFuture<F>
sourcepub fn new(future: F, params: &TimeoutServiceParams) -> Self
pub fn new(future: F, params: &TimeoutServiceParams) -> Self
Given a future
, an implementor of AsyncSleep
, a kind
for this timeout, and a duration
,
wrap the future
inside a Timeout
future and create a new TimeoutServiceFuture
that
will output an SdkError
if future
doesn’t complete before duration
has elapsed.
sourcepub fn no_timeout(future: F) -> Self
pub fn no_timeout(future: F) -> Self
Create a TimeoutServiceFuture
that will never time out.
Trait Implementations
sourceimpl<InnerFuture, T, E> Future for TimeoutServiceFuture<InnerFuture>where
InnerFuture: Future<Output = Result<T, SdkError<E>>>,
impl<InnerFuture, T, E> Future for TimeoutServiceFuture<InnerFuture>where
InnerFuture: Future<Output = Result<T, SdkError<E>>>,
impl<'__pin, F> Unpin for TimeoutServiceFuture<F>where
__Origin<'__pin, F>: Unpin,
Auto Trait Implementations
impl<F> !RefUnwindSafe for TimeoutServiceFuture<F>
impl<F> Send for TimeoutServiceFuture<F>where
F: Send,
impl<F> !Sync for TimeoutServiceFuture<F>
impl<F> !UnwindSafe for TimeoutServiceFuture<F>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> FutureExt for Twhere
T: Future + ?Sized,
impl<T> FutureExt for Twhere
T: Future + ?Sized,
fn map<U, F>(self, f: F) -> Map<Self, F>where
F: FnOnce(Self::Output) -> U,
fn map<U, F>(self, f: F) -> Map<Self, F>where
F: FnOnce(Self::Output) -> U,
fn map_into<U>(self) -> MapInto<Self, U>where
Self::Output: Into<U>,
fn map_into<U>(self) -> MapInto<Self, U>where
Self::Output: Into<U>,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
f
. Read morefn left_future<B>(self) -> Either<Self, B>where
B: Future<Output = Self::Output>,
fn left_future<B>(self) -> Either<Self, B>where
B: Future<Output = Self::Output>,
fn right_future<A>(self) -> Either<A, Self>where
A: Future<Output = Self::Output>,
fn right_future<A>(self) -> Either<A, Self>where
A: Future<Output = Self::Output>,
fn into_stream(self) -> IntoStream<Self>
fn into_stream(self) -> IntoStream<Self>
fn flatten(self) -> Flatten<Self>where
Self::Output: Future,
fn flatten(self) -> Flatten<Self>where
Self::Output: Future,
fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
fn fuse(self) -> Fuse<Self>
fn fuse(self) -> Fuse<Self>
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read morefn inspect<F>(self, f: F) -> Inspect<Self, F>where
F: FnOnce(&Self::Output),
fn inspect<F>(self, f: F) -> Inspect<Self, F>where
F: FnOnce(&Self::Output),
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: UnwindSafe,
fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a, Global>>where
Self: 'a + Send,
fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a, Global>>where
Self: 'a + Send,
fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>>where
Self: 'a,
fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>>where
Self: 'a,
fn unit_error(self) -> UnitError<Self>
fn unit_error(self) -> UnitError<Self>
fn never_error(self) -> NeverError<Self>
fn never_error(self) -> NeverError<Self>
fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>where
Self: Unpin,
fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>where
Self: Unpin,
Future::poll
on Unpin
future types.fn now_or_never(self) -> Option<Self::Output>
fn now_or_never(self) -> Option<Self::Output>
Future::poll
. Read more