Trait bevy_mod_sysfail::FailureMode
source · pub trait FailureMode {
type ID: Hash + Eq;
// Required method
fn identify(&self) -> Self::ID;
// Provided methods
fn log_level(&self) -> LogLevel { ... }
fn cooldown(&self) -> Duration { ... }
fn display(&self) -> Option<String> { ... }
fn log(&self) { ... }
}
Expand description
Something that can be logged in a sysfail
handler
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn log_level(&self) -> LogLevel
fn log_level(&self) -> LogLevel
👎Deprecated since 4.0.0: This is ignored
Deprecated: this is ignored.
sourcefn cooldown(&self) -> Duration
fn cooldown(&self) -> Duration
How long an error must not be produced in order to be displayed again.
This controls when Failure::get_error
returns an error.
Return Duration::ZERO
to trigger Failure::get_error
each time there
is an error.
sourcefn display(&self) -> Option<String>
fn display(&self) -> Option<String>
👎Deprecated since 4.0.0: This crate now directly uses the fmt::Display impl on the error.
Deprecated, this does nothing.
sourcefn log(&self)
fn log(&self)
What happens, by default this logs based on the return value of
FailureMode::log_level
.
Examples
https://crates.io/crates/bevy_debug_text_overlay provides a wrapper struct to replace log-printing with displaying errors on screen.