Skip to main content

pin_ref

Function pin_ref 

Source
pub fn pin_ref<Storage, T, S>(state: &State<Storage, T, S>) -> Pin<&T>
where T: StateMachineImpl, Storage: SPinRef,
Expand description

Borrows a state’s runtime value through its storage’s pin guarantee.

This is a free function rather than an inherent State method so generic state-machine APIs stay focused on receiver types and transitions. Use it when a method accepts &State<S, T, Current> and needs to call an API on T that requires Pin<&T>.