pub struct Loop { /* private fields */ }Expand description
Represents a single alarm event processing loop.
One instance is created per each alarm-capable low-level device. The Loop
is responsible for managing the lifecycle of wake alarms, including their
creation, scheduling, and cancellation. It interacts with the underlying
hardware timer through a TimerOps trait object.
Implementations§
Source§impl Loop
impl Loop
Sourcepub fn new(
scope: ScopeHandle,
device_proxy: DeviceProxy,
inspect: Node,
utc_clock: UtcClock,
) -> Self
pub fn new( scope: ScopeHandle, device_proxy: DeviceProxy, inspect: Node, utc_clock: UtcClock, ) -> Self
Creates a new instance of Loop.
This function initializes a new Loop with a connection to a low-level
hardware timer device. It spawns two background tasks: one for the main
timer event loop and another for monitoring UTC clock changes.
§Args
scope: Thefasync::ScopeHandleto spawn background tasks in.device_proxy: Affhh::DeviceProxyfor communicating with the hardware timer.inspect: Afinspect::Nodefor recording diagnostics.utc_clock: Afxr::UtcClockfor tracking UTC time.
§Returns
A new instance of Loop.
Sourcepub fn new_emulated(
scope: ScopeHandle,
inspect: Node,
utc_clock: UtcClock,
) -> Self
pub fn new_emulated( scope: ScopeHandle, inspect: Node, utc_clock: UtcClock, ) -> Self
Creates a new instance of Loop with emulated wake alarms.
This function is similar to new, but it uses an emulated timer instead
of a real hardware timer. This is useful for testing environments where
a hardware timer may not be available.
§Args
scope: Thefasync::ScopeHandleto spawn background tasks in.inspect: Afinspect::Nodefor recording diagnostics.utc_clock: Afxr::UtcClockfor tracking UTC time.
§Returns
A new instance of Loop with an emulated timer.
Auto Trait Implementations§
impl Freeze for Loop
impl !RefUnwindSafe for Loop
impl !Send for Loop
impl !Sync for Loop
impl Unpin for Loop
impl !UnwindSafe for Loop
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