Struct ShutdownBuilder
pub struct ShutdownBuilder<T> { /* private fields */ }
Expand description
ShutdownBuilder
to build a Shutdown
manager.
Implementations§
§impl ShutdownBuilder<WithSignal<Default>>
impl ShutdownBuilder<WithSignal<Default>>
pub fn new() -> ShutdownBuilder<WithSignal<Default>>
pub fn new() -> ShutdownBuilder<WithSignal<Default>>
Create a new ShutdownBuilder
, which by default
is ready to build a Shutdown
.
pub fn without_signal(self) -> ShutdownBuilder<WithoutSignal>
pub fn without_signal(self) -> ShutdownBuilder<WithoutSignal>
Create a ShutdownBuilder
without a trigger signal,
meaning it will act like a WaitGroup.
pub fn with_signal<F>(self, future: F) -> ShutdownBuilder<WithSignal<F>>
pub fn with_signal<F>(self, future: F) -> ShutdownBuilder<WithSignal<F>>
Create a ShutdownBuilder
with a custom Future
signal.
§impl<S> ShutdownBuilder<WithSignal<S>>
impl<S> ShutdownBuilder<WithSignal<S>>
pub fn with_overwrite_fn<F, Fut>(
self,
f: F,
) -> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
pub fn with_overwrite_fn<F, Fut>( self, f: F, ) -> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
Create a ShutdownBuilder
with a function
which creates a future that will be awaited on
as an alternative to waiting for all jobs to be complete.
pub fn with_delay(self, delay: Duration) -> ShutdownBuilder<WithSignal<S>>
pub fn with_delay(self, delay: Duration) -> ShutdownBuilder<WithSignal<S>>
Attach a delay to this ShutdownBuilder
which will used as a timeout buffer between the shutdown
trigger signal and signalling the jobs to be cancelled.
pub fn maybe_with_delay(
self,
delay: Option<Duration>,
) -> ShutdownBuilder<WithSignal<S>>
pub fn maybe_with_delay( self, delay: Option<Duration>, ) -> ShutdownBuilder<WithSignal<S>>
Attach a delay to this ShutdownBuilder
which will used as a timeout buffer between the shutdown
trigger signal and signalling the jobs to be cancelled.
pub fn set_delay(
&mut self,
delay: Duration,
) -> &mut ShutdownBuilder<WithSignal<S>>
pub fn set_delay( &mut self, delay: Duration, ) -> &mut ShutdownBuilder<WithSignal<S>>
Attach a delay to this ShutdownBuilder
which will used as a timeout buffer between the shutdown
trigger signal and signalling the jobs to be cancelled.
§impl<S, F> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
impl<S, F> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
pub fn with_delay(
self,
delay: Duration,
) -> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
pub fn with_delay( self, delay: Duration, ) -> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
Attach a delay to this ShutdownBuilder
which will used as a timeout buffer between the shutdown
trigger signal and signalling the jobs to be cancelled.
pub fn maybe_with_delay(
self,
delay: Option<Duration>,
) -> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
pub fn maybe_with_delay( self, delay: Option<Duration>, ) -> ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
Attach a delay to this ShutdownBuilder
which will used as a timeout buffer between the shutdown
trigger signal and signalling the jobs to be cancelled.
pub fn set_delay(
&mut self,
delay: Duration,
) -> &mut ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
pub fn set_delay( &mut self, delay: Duration, ) -> &mut ShutdownBuilder<WithSignalAndOverwriteFn<S, F>>
Attach a delay to this ShutdownBuilder
which will used as a timeout buffer between the shutdown
trigger signal and signalling the jobs to be cancelled.
§impl ShutdownBuilder<WithoutSignal>
impl ShutdownBuilder<WithoutSignal>
§impl<I> ShutdownBuilder<WithSignal<I>>where
I: IntoFuture,
impl<I> ShutdownBuilder<WithSignal<I>>where
I: IntoFuture,
§impl<I, F, Fut> ShutdownBuilder<WithSignalAndOverwriteFn<I, F>>
impl<I, F, Fut> ShutdownBuilder<WithSignalAndOverwriteFn<I, F>>
Trait Implementations§
§impl<T> Debug for ShutdownBuilder<T>where
T: Debug,
impl<T> Debug for ShutdownBuilder<T>where
T: Debug,
§impl Default for ShutdownBuilder<WithSignal<Default>>
impl Default for ShutdownBuilder<WithSignal<Default>>
§fn default() -> ShutdownBuilder<WithSignal<Default>>
fn default() -> ShutdownBuilder<WithSignal<Default>>
Auto Trait Implementations§
impl<T> Freeze for ShutdownBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for ShutdownBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for ShutdownBuilder<T>where
T: Send,
impl<T> Sync for ShutdownBuilder<T>where
T: Sync,
impl<T> Unpin for ShutdownBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for ShutdownBuilder<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more