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 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§
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
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
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().