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§
sourcefn register_diagnostic(&mut self, diagnostic: Diagnostic) -> &mut Self
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();
Object Safety§
This trait is not object safe.