Accessor functions for predefined slices to avoid allocations in external packages These return the same slice instance, so they're zero-allocation ValidFromIdle returns a predefined slice containing only StateIdle. Use this to avoid allocations when calling AwaitAndTransition or TryTransition.
()
| 60 | // ValidFromIdle returns a predefined slice containing only StateIdle. |
| 61 | // Use this to avoid allocations when calling AwaitAndTransition or TryTransition. |
| 62 | func ValidFromIdle() []ConnState { |
| 63 | return validFromIdle |
| 64 | } |
| 65 | |
| 66 | // ValidFromCreatedIdleOrUnusable returns a predefined slice for initialization transitions. |
| 67 | // Use this to avoid allocations when calling AwaitAndTransition or TryTransition. |