on

inline fun <R> HostRuntime.on(version: Version, block: () -> R): R?

Execute a block and return its result if this runtime's is running the provided version, otherwise return null. If this runtime's version can't be detected, null will be returned.


inline fun <R> HostRuntime.on(range: Version.Range, block: () -> R): R?

Execute a block and return its result if this runtime's version is in the provided range, otherwise return null. If this runtime's version can't be detected, null will be returned.