pub struct FlightRecorder { /* private fields */ }Expand description
Keeps the last minutes on screen in memory, the way a flight recorder does, so that a bug can show what led to it. Put it anywhere in the app’s views: it draws nothing. A film costs little because each thing drawn is stored once and a screen that does not change costs nothing, and it runs only when the app paints.
It sees all that the app shows, so it writes nothing anywhere: only
Self::film gets anything out of it.
use ravenrs_movie::FlightRecorder;
// The last three minutes.
let recorder = FlightRecorder::new(180.0);
assert!(recorder.film().is_none(), "nothing on screen yet");Implementations§
Source§impl FlightRecorder
impl FlightRecorder
Sourcepub fn new(seconds: f64) -> Self
pub fn new(seconds: f64) -> Self
A recorder that keeps at least half of seconds, and up to all of them.
Sourcepub fn film(&self) -> Option<Movie>
pub fn film(&self) -> Option<Movie>
The film so far, to look at, edit or send. Recording goes on.
Sourcepub fn set_paused(&self, paused: bool)
pub fn set_paused(&self, paused: bool)
Stops or resumes noting anything, for screens that should stay out of it.
Trait Implementations§
Source§impl Clone for FlightRecorder
impl Clone for FlightRecorder
Source§fn clone(&self) -> FlightRecorder
fn clone(&self) -> FlightRecorder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlightRecorder
impl Debug for FlightRecorder
Auto Trait Implementations§
impl !RefUnwindSafe for FlightRecorder
impl !Send for FlightRecorder
impl !Sync for FlightRecorder
impl !UnwindSafe for FlightRecorder
impl Freeze for FlightRecorder
impl Unpin for FlightRecorder
impl UnsafeUnpin for FlightRecorder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.