pub struct PlatformFrameSignal {}Expand description
Preserves the first platform frame request time across coalesced notifications.
Producers may record from a platform thread without waiting for the UI thread.
The consumer drains the timestamp before dispatching the request on the UI thread.
The timestamp offset and source share one atomic word so coalescing cannot
mix a request’s time with another request’s source. The low bit encodes the
source; the remaining bits encode nanoseconds from origin. u64::MAX is empty.
Without the profiler feature, this accumulator has no timestamp storage.
Implementations§
Source§impl PlatformFrameSignal
impl PlatformFrameSignal
Sourcepub fn new() -> PlatformFrameSignal
pub fn new() -> PlatformFrameSignal
Creates an empty signal accumulator.
Sourcepub fn capture(capture: impl FnOnce() -> Instant) -> Option<Instant>
pub fn capture(capture: impl FnOnce() -> Instant) -> Option<Instant>
Captures a platform request timestamp only when profiling is enabled.
The closure is not invoked in profiler-disabled builds.
Sourcepub fn record(&self, at: Instant, source: FrameRequestSource)
pub fn record(&self, at: Instant, source: FrameRequestSource)
Records a platform frame request, retaining the first undrained timestamp.
Sourcepub fn take(&self) -> Option<(Instant, FrameRequestSource)>
pub fn take(&self) -> Option<(Instant, FrameRequestSource)>
Drains the first platform frame request time and source, leaving the accumulator empty.
Trait Implementations§
Source§impl Default for PlatformFrameSignal
impl Default for PlatformFrameSignal
Source§fn default() -> PlatformFrameSignal
fn default() -> PlatformFrameSignal
Auto Trait Implementations§
impl Freeze for PlatformFrameSignal
impl RefUnwindSafe for PlatformFrameSignal
impl Send for PlatformFrameSignal
impl Sync for PlatformFrameSignal
impl Unpin for PlatformFrameSignal
impl UnsafeUnpin for PlatformFrameSignal
impl UnwindSafe for PlatformFrameSignal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().