Struct vector_common::shutdown::SourceShutdownCoordinator
source · pub struct SourceShutdownCoordinator { /* private fields */ }
Implementations§
source§impl SourceShutdownCoordinator
impl SourceShutdownCoordinator
sourcepub fn register_source(
&mut self,
id: &ComponentKey,
internal: bool,
) -> (ShutdownSignal, impl Future<Output = ()>)
pub fn register_source( &mut self, id: &ComponentKey, internal: bool, ) -> (ShutdownSignal, impl Future<Output = ()>)
Creates the necessary Triggers and Tripwires for coordinating shutdown of this Source and
stores them as needed. Returns the ShutdownSignal
for this Source as well as a Tripwire
that will be notified if the Source should be forcibly shut down.
sourcepub fn takeover_source(&mut self, id: &ComponentKey, other: &mut Self)
pub fn takeover_source(&mut self, id: &ComponentKey, other: &mut Self)
Takes ownership of all internal state for the given source from another ShutdownCoordinator
.
§Panics
Panics if the other coordinator already had its triggers removed.
sourcepub fn shutdown_all(self, deadline: Option<Instant>) -> impl Future<Output = ()>
pub fn shutdown_all(self, deadline: Option<Instant>) -> impl Future<Output = ()>
Sends a signal to begin shutting down to all sources, and returns a future that
resolves once all sources have either shut down completely, or have been sent the
force shutdown signal. The force shutdown signal will be sent to any sources that
don’t cleanly shut down before the given deadline
.
§Panics
Panics if this coordinator has had its triggers removed (ie
has been taken over with Self::takeover_source
).
sourcepub fn shutdown_source(
&mut self,
id: &ComponentKey,
deadline: Instant,
) -> impl Future<Output = bool>
pub fn shutdown_source( &mut self, id: &ComponentKey, deadline: Instant, ) -> impl Future<Output = bool>
Sends the signal to the given source to begin shutting down. Returns a future that resolves
when the source has finished shutting down cleanly or been sent the force shutdown signal.
The returned future resolves to a bool that indicates if the source shut down cleanly before
the given deadline
. If the result is false then that means the source failed to shut down
before deadline
and had to be force-shutdown.
§Panics
Panics if this coordinator has had its triggers removed (ie
has been taken over with Self::takeover_source
).
sourcepub fn shutdown_tripwire(&self) -> BoxFuture<'static, ()>
pub fn shutdown_tripwire(&self) -> BoxFuture<'static, ()>
Returned future will finish once all current sources have finished.
Trait Implementations§
source§impl Debug for SourceShutdownCoordinator
impl Debug for SourceShutdownCoordinator
source§impl Default for SourceShutdownCoordinator
impl Default for SourceShutdownCoordinator
source§fn default() -> SourceShutdownCoordinator
fn default() -> SourceShutdownCoordinator
Auto Trait Implementations§
impl Freeze for SourceShutdownCoordinator
impl !RefUnwindSafe for SourceShutdownCoordinator
impl Send for SourceShutdownCoordinator
impl Sync for SourceShutdownCoordinator
impl Unpin for SourceShutdownCoordinator
impl !UnwindSafe for SourceShutdownCoordinator
Blanket Implementations§
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> 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>
§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
] or
a color-specific method, such as [OwoColorize::green
], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
] or
a color-specific method, such as [OwoColorize::on_yellow
], Read more