pub struct PresentStatsHandle { /* private fields */ }Expand description
A shared slot the platform writes the latest PresentStats into.
Create one, clone it into the stats field of the window options, and keep
the original to read the statistics of the most recent present while the
window runs. The handle reports zeros until the first present.
§Examples
use smudge_platform::PresentStatsHandle;
let handle = PresentStatsHandle::new();
let reader = handle.clone();
assert_eq!(reader.get().buffer_age, 0);Implementations§
Source§impl PresentStatsHandle
impl PresentStatsHandle
Sourcepub fn new() -> PresentStatsHandle
pub fn new() -> PresentStatsHandle
Creates a handle that reports zeros until the first present.
Sourcepub fn get(&self) -> PresentStats
pub fn get(&self) -> PresentStats
Returns the statistics of the most recent present.
Sourcepub fn adapter(&self) -> Option<AdapterSummary>
pub fn adapter(&self) -> Option<AdapterSummary>
Returns the GPU adapter the window presents through, when it knows one.
The platform reports the adapter once, when it sets the GPU
presentation path up, and only when the window was opened with a
handle in its options. A window on the CPU renderer reports None,
which is how a reader tells a GPU window from a CPU one.
Trait Implementations§
Source§impl Clone for PresentStatsHandle
impl Clone for PresentStatsHandle
Source§impl Debug for PresentStatsHandle
impl Debug for PresentStatsHandle
Auto Trait Implementations§
impl !RefUnwindSafe for PresentStatsHandle
impl !Send for PresentStatsHandle
impl !Sync for PresentStatsHandle
impl !UnwindSafe for PresentStatsHandle
impl Forget for PresentStatsHandle
impl Freeze for PresentStatsHandle
impl Move for PresentStatsHandle
impl Unpin for PresentStatsHandle
impl UnsafeUnpin for PresentStatsHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.