RegisterDiagnostic

Trait RegisterDiagnostic 

Source
pub trait RegisterDiagnostic {
    // Required method
    fn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut Self;
}
Expand description

Extend App with new register_diagnostic function.

Required Methods§

Source

fn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut Self

Register a new Diagnostic with an App.

Will initialize a DiagnosticsStore if it doesn’t exist.

use bevy_app::App;
use bevy_diagnostic::{Diagnostic, DiagnosticsPlugin, DiagnosticPath, RegisterDiagnostic};

const UNIQUE_DIAG_PATH: DiagnosticPath = DiagnosticPath::const_new("foo/bar");

App::new()
    .register_diagnostic(Diagnostic::new(UNIQUE_DIAG_PATH))
    .add_plugins(DiagnosticsPlugin)
    .run();

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RegisterDiagnostic for App

Source§

fn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut Self

Source§

impl RegisterDiagnostic for SubApp

Source§

fn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut Self

Implementors§