pub enum FakeClockRequest {
Get {
responder: FakeClockGetResponder,
},
RegisterEventInMonotonic {
event: EventPair,
time: MonotonicInstant,
control_handle: FakeClockControlHandle,
},
RegisterEventInBoot {
event: EventPair,
time: BootInstant,
control_handle: FakeClockControlHandle,
},
RescheduleEventInMonotonic {
event: EventPair,
time: MonotonicInstant,
responder: FakeClockRescheduleEventInMonotonicResponder,
},
RescheduleEventInBoot {
event: EventPair,
time: BootInstant,
responder: FakeClockRescheduleEventInBootResponder,
},
CancelEvent {
event: EventPair,
responder: FakeClockCancelEventResponder,
},
CreateNamedDeadlineInMonotonic {
id: DeadlineId,
duration: i64,
responder: FakeClockCreateNamedDeadlineInMonotonicResponder,
},
CreateNamedDeadlineInBoot {
id: DeadlineId,
duration: i64,
responder: FakeClockCreateNamedDeadlineInBootResponder,
},
}
Expand description
Allows access to fake clocks managed by FakeClockControl
.
Variants§
Get
Gets the current time.
Fields
responder: FakeClockGetResponder
RegisterEventInMonotonic
Registers the event handle event
to be signaled with ZX_EVENTPAIR_SIGNALED
when the
provided time
is reached by the fake monotonic clock.
The FakeClock
instance will retain this event (even after it’s fired) for as long as the
client-side of the provided event pair event
is open.
RegisterEventInBoot
Registers the event handle event
to be signaled with ZX_EVENTPAIR_SIGNALED
when the
provided time
is reached by the fake boot clock.
The FakeClock
instance will retain this event (even after it’s fired) for as long as the
client-side of the provided event pair event
is open.
RescheduleEventInMonotonic
Reschedules an event to be signalled with ZX_EVENTPAIR_SIGNALED
at the new deadline in
time
on the monotonic clock.
event
is a duplicate of the client-side of the event pair, and it’s used to retrieve the
originally registered event through its kernel object identifier.
Fields
time: MonotonicInstant
RescheduleEventInBoot
Reschedules an event to be signalled with ZX_EVENTPAIR_SIGNALED
at the new deadline in
time
on the boot clock.
event
is a duplicate of the client-side of the event pair, and it’s used to retrieve the
originally registered event through its kernel object identifier.
CancelEvent
Cancels a previously registered event.
event
is a duplicate of the client-side of the event pair, and it’s used to retrieve the
originally registered event through its kernel object identifier.
CreateNamedDeadlineInMonotonic
Calculate and set a deadline associated with an id on the monotonic clock.
The returned deadline
is calculated as duration
after the current fake time.
FakeClock emits two events: A SET
event immediately, and an EXPIRED
event when the
deadline expires. A test using FakeClockControl
may reference events related to the
deadline using a matching id
. See FakeClockControl.SetStopPoint
for information on how a
test can wait for a deadline event.
CreateNamedDeadlineInBoot
Calculate and set a deadline associated with an id on the boot clock.
The returned deadline
is calculated as duration
after the current fake time.
FakeClock emits two events: A SET
event immediately, and an EXPIRED
event when the
deadline expires. A test using FakeClockControl
may reference events related to the
deadline using a matching id
. See FakeClockControl.SetStopPoint
for information on how a
test can wait for a deadline event.
Implementations§
Source§impl FakeClockRequest
impl FakeClockRequest
pub fn into_get(self) -> Option<FakeClockGetResponder>
pub fn into_register_event_in_monotonic( self, ) -> Option<(EventPair, MonotonicInstant, FakeClockControlHandle)>
pub fn into_register_event_in_boot( self, ) -> Option<(EventPair, BootInstant, FakeClockControlHandle)>
pub fn into_reschedule_event_in_monotonic( self, ) -> Option<(EventPair, MonotonicInstant, FakeClockRescheduleEventInMonotonicResponder)>
pub fn into_reschedule_event_in_boot( self, ) -> Option<(EventPair, BootInstant, FakeClockRescheduleEventInBootResponder)>
pub fn into_cancel_event( self, ) -> Option<(EventPair, FakeClockCancelEventResponder)>
pub fn into_create_named_deadline_in_monotonic( self, ) -> Option<(DeadlineId, i64, FakeClockCreateNamedDeadlineInMonotonicResponder)>
pub fn into_create_named_deadline_in_boot( self, ) -> Option<(DeadlineId, i64, FakeClockCreateNamedDeadlineInBootResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL