Skip to main content

PerformancePlugin

Struct PerformancePlugin 

Source
pub struct PerformancePlugin { /* private fields */ }
Expand description

Performance monitoring plugin

Tracks frame times, FPS, and provides performance metrics.

§Example

use revue::plugin::PerformancePlugin;

let app = App::builder()
    .plugin(PerformancePlugin::new())
    .build();

// Access metrics via plugin context
// ctx.get_plugin_data::<f64>("performance", "fps")

Implementations§

Source§

impl PerformancePlugin

Source

pub fn new() -> Self

Create a new performance plugin

Source

pub fn max_samples(self, count: usize) -> Self

Set maximum number of frame samples to keep

Source

pub fn report_interval(self, interval: Duration) -> Self

Set report interval

Trait Implementations§

Source§

impl Default for PerformancePlugin

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Plugin for PerformancePlugin

Source§

fn name(&self) -> &str

Plugin name (should be unique)
Source§

fn priority(&self) -> i32

Plugin priority (higher = runs first) Read more
Source§

fn on_init(&mut self, ctx: &mut PluginContext) -> Result<()>

Called when the plugin is first registered Read more
Source§

fn on_mount(&mut self, _ctx: &mut PluginContext) -> Result<()>

Called when the app starts running Read more
Source§

fn on_tick(&mut self, ctx: &mut PluginContext, delta: Duration) -> Result<()>

Called on each tick (frame update) Read more
Source§

fn on_unmount(&mut self, ctx: &mut PluginContext) -> Result<()>

Called when the app is shutting down Read more
Source§

fn styles(&self) -> Option<&str>

Optional CSS styles contributed by this plugin 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.