pub struct TimelineChangeObserver { /* private fields */ }Expand description
Used to observe timeline changes from within TimerOps.
Implementations§
Source§impl TimelineChangeObserver
impl TimelineChangeObserver
pub fn new( timeline_change_counter: Counter, timeline_change_registration: UnboundedSender<bool>, ) -> Self
Sourcepub fn reset_timeline_change_counter(&self) -> i64
pub fn reset_timeline_change_counter(&self) -> i64
Resets the change counter, and returns the observed value.
The reset is done in such a way that any “sets” that come while “reset” is running does not lose a “set”.
What is expected here is that at the end either (1) COUNTER_POSITIVE is cleared, or (2) if it happens not to be cleared due to a race, that Starnix has a way to probe the COUNTER_POSITIVE and react again if it remains asserted (without being strobed to zero) after this call returns.
(2) happens to be true today due to how file ops work, and will likely continue to be so. But it’s a tad bit disconcerting that the correct operation of this counter depends on two bits of code that are somewhat far away from each other. A safer alternative would be a “counter swap” operation that would write a value and return the old value atomically, but that does not exist today.
pub fn get_timeline_change_counter_ref(&self) -> &Counter
pub fn set_timeline_change_interest(&mut self, is_interested: bool)
Trait Implementations§
Source§impl Debug for TimelineChangeObserver
impl Debug for TimelineChangeObserver
Auto Trait Implementations§
impl Freeze for TimelineChangeObserver
impl !RefUnwindSafe for TimelineChangeObserver
impl Send for TimelineChangeObserver
impl Sync for TimelineChangeObserver
impl Unpin for TimelineChangeObserver
impl !UnwindSafe for TimelineChangeObserver
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [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 more