pub struct Diagnostics { /* private fields */ }Expand description
What a platform shares with the panel of a DiagnosticsHost: it records
frames here, says how to describe the GPU, and opens the panel.
Frames are kept out of reactive state on purpose: recording one must never ask for another.
Implementations§
Source§impl Diagnostics
impl Diagnostics
Sourcepub fn start_test(&self)
pub fn start_test(&self)
Opens the panel and redraws the window nonstop for a few seconds, to tell the person in plain words how fast this machine draws this app.
Sourcepub fn record(&self, sample: FrameSample)
pub fn record(&self, sample: FrameSample)
Adds a frame to the log.
Sourcepub fn set_view_costs(&self, costs: Vec<ViewCost>)
pub fn set_view_costs(&self, costs: Vec<ViewCost>)
Says what each type of view cost in the latest build; see Ui::view_costs.
Sourcepub fn trace_json(&self) -> String
pub fn trace_json(&self) -> String
The latest frames in the Trace Event format, which Perfetto opens.
Sourcepub fn set_report_source(&self, source: impl Fn() -> DiagnosticReport + 'static)
pub fn set_report_source(&self, source: impl Fn() -> DiagnosticReport + 'static)
Sets how to describe the GPU. Describing it can take a moment, so source
only runs when the panel first needs it, and again after the next call here.
Sourcepub fn set_bug_reporter(
&self,
new_issue: impl Into<String>,
open: impl Fn(&str) -> Result<(), String> + 'static,
)
pub fn set_bug_reporter( &self, new_issue: impl Into<String>, open: impl Fn(&str) -> Result<(), String> + 'static, )
Adds a button to the panel that starts a bug report on the new_issue page.
open shows a URL to the person, in a browser on the desktop, and says why
when it cannot. Nothing is sent: the person reviews and submits on that page.
Sourcepub fn report(&self) -> Option<DiagnosticReport>
pub fn report(&self) -> Option<DiagnosticReport>
The report, gathering it if needed; None before a source is set.
Trait Implementations§
Source§impl Clone for Diagnostics
impl Clone for Diagnostics
Source§fn clone(&self) -> Diagnostics
fn clone(&self) -> Diagnostics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more