Skip to main content

ShutdownReport

Struct ShutdownReport 

Source
pub struct ShutdownReport {
Show 15 fields pub name: String, pub elapsed: Duration, pub completed: usize, pub cancelled: usize, pub aborted: usize, pub failed: usize, pub panicked: usize, pub timed_out: usize, pub leaked: usize, pub blocking_still_running: usize, pub children: Vec<ShutdownReport>, pub remaining_tasks: Vec<TaskSnapshot>, pub remaining_tasks_omitted: usize, pub blocking_tasks: Vec<BlockingTaskSnapshot>, pub annotations: Vec<ShutdownAnnotation>,
}
Expand description

Represents shutdown report.

Fields§

§name: String

The name value.

§elapsed: Duration

The elapsed value.

§completed: usize

The completed value.

§cancelled: usize

The cancelled value.

§aborted: usize

The aborted value.

§failed: usize

Lifecycle components that completed with an explicit failure.

§panicked: usize

The panicked value.

§timed_out: usize

Tasks this shutdown aborted after its deadline expired, plus tasks still registered when it finished.

§leaked: usize

Tasks still registered when the shutdown finished.

§blocking_still_running: usize

The blocking still running value.

§children: Vec<ShutdownReport>

The children value.

§remaining_tasks: Vec<TaskSnapshot>

Tasks still registered when the shutdown finished, at most Self::REMAINING_TASKS_LIMIT of them.

§remaining_tasks_omitted: usize

Remaining tasks left out of remaining_tasks because of its limit. They are still counted in leaked.

§blocking_tasks: Vec<BlockingTaskSnapshot>

The blocking tasks value.

§annotations: Vec<ShutdownAnnotation>

The annotations value.

Implementations§

Source§

impl ShutdownReport

Source

pub const REMAINING_TASKS_LIMIT: usize = 64

Maximum number of task snapshots kept in remaining_tasks.

The limit bounds the size of a report for a group that leaks many tasks; the counters stay exact.

Source

pub fn new(name: impl Into<String>, elapsed: Duration) -> Self

Creates a new ShutdownReport.

Source

pub fn is_healthy(&self) -> bool

Returns whether healthy.

Source

pub fn assert_no_task_leak(&self) -> Result<(), String>

Returns the assert no task leak.

Source

pub fn log_if_unhealthy(&self)

Executes log if unhealthy.

Source

pub fn to_json(&self) -> String

Converts this value to json.

Source

pub fn merge_blocking(&mut self, snapshot: BlockingExecutorSnapshot)

Executes merge blocking.

Trait Implementations§

Source§

impl Clone for ShutdownReport

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShutdownReport

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Serialize for ShutdownReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more