Expand description
Intrusive high resolution timers.
Allows running timer callbacks without doing allocations at the time of starting the timer. For now, only one timer per type is allowed.
§Vocabulary
States:
- Stopped: initialized but not started, or cancelled, or not restarted.
- Started: initialized and started or restarted.
- Running: executing the callback.
Operations:
- Start
- Cancel
- Restart
Events:
- Expire
§State Diagram
                                                  Return NoRestart
                      +---------------------------------------------------------------------+
                      |                                                                     |
                      |                                                                     |
                      |                                                                     |
                      |                                         Return Restart              |
                      |                                      +------------------------+     |
                      |                                      |                        |     |
                      |                                      |                        |     |
                      v                                      v                        |     |
          +-----------------+      Start      +------------------+           +--------+-----+--+
          |                 +---------------->|                  |           |                 |
Init      |                 |                 |                  |  Expire   |                 |
--------->|    Stopped      |                 |      Started     +---------->|     Running     |
          |                 |     Cancel      |                  |           |                 |
          |                 |<----------------+                  |           |                 |
          +-----------------+                 +---------------+--+           +-----------------+
                                                    ^         |
                                                    |         |
                                                    +---------+
                                                     RestartA timer is initialized in the stopped state. A stopped timer can be
started by the start operation, with an expiry time. After the
start operation, the timer is in the started state. When the timer
expires, the timer enters the running state and the handler is
executed. After the handler has returned, the timer may enter the
*started or stopped state, depending on the return value of the
handler. A timer in the started or running state may be canceled
by the cancel operation. A timer that is cancelled enters the stopped
state.
A cancel or restart operation on a timer in the running state takes
effect after the handler has returned and the timer has transitioned
out of the running state.
A restart operation on a timer in the stopped state is equivalent to a
start operation.
Structs§
- AbsoluteHard Mode 
- Timer with absolute expiration, handled in hard irq context.
- AbsoluteMode 
- Timer that expires at a fixed point in time.
- AbsolutePinned Hard Mode 
- Timer with absolute expiration, pinned to CPU and handled in hard irq context.
- AbsolutePinned Mode 
- Timer with absolute expiration time, pinned to its current CPU.
- AbsolutePinned Soft Mode 
- Timer with absolute expiration, pinned to CPU and handled in soft irq context.
- AbsoluteSoft Mode 
- Timer with absolute expiration, handled in soft irq context.
- ArcHrTimer Handle 
- A handle for an Arc<HasHrTimer<T>>returned by a call toHrTimerPointer::start.
- BoxHrTimer Handle 
- A handle for a Box<HasHrTimer<T>>returned by a call toHrTimerPointer::start.
- HrTimer
- A timer backed by a C struct hrtimer.
- HrTimerCallback Context 
- Privileged smart-pointer for a HrTimercallback context.
- PinHrTimer Handle 
- A handle for a Pin<&HasHrTimer>. When the handle exists, the timer might be running.
- PinMutHrTimer Handle 
- A handle for a Pin<&mut HasHrTimer>. When the handle exists, the timer might be running.
- RelativeHard Mode 
- Timer with relative expiration, handled in hard irq context.
- RelativeMode 
- Timer that expires after a delay from now.
- RelativePinned Hard Mode 
- Timer with relative expiration, pinned to CPU and handled in hard irq context.
- RelativePinned Mode 
- Timer with relative expiration time, pinned to its current CPU.
- RelativePinned Soft Mode 
- Timer with absolute expiration, pinned to CPU and handled in soft irq context.
- RelativeSoft Mode 
- Timer with relative expiration, handled in soft irq context.
Enums§
- HrTimerRestart 
- Restart policy for timers.
Traits§
- HasHrTimer 
- Implemented by structs that contain timer nodes.
- HrTimerCallback 
- Implemented by structs that can be the target of a timer callback.
- HrTimerExpires 
- Time representations that can be used as expiration values in HrTimer.
- HrTimerHandle 
- A handle representing a potentially running timer.
- HrTimerMode 
- Operational mode of HrTimer.
- HrTimerPointer 
- Implemented by pointer types that point to structs that contain a HrTimer.
- RawHrTimer Callback 
- Implemented by HrTimerPointerimplementers to give the C timer callback a function to call.
- ScopedHrTimer Pointer 
- A trait for stack allocated timers.
- UnsafeHrTimer Pointer 
- Unsafe version of HrTimerPointerfor situations where leaking theHrTimerHandlereturned bystartwould be unsound. This is the case for stack allocated timers.
Type Aliases§
- HrTimerInstant 
- A type-alias to refer to the Instant<C>for a givenTfromHrTimer<T>.