data.State.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of noise-kotlin Show documentation
Show all versions of noise-kotlin Show documentation
Noise protocols based on Diffie-Hellman key agreement
The newest version!
package nl.sanderdijkhuis.noise.data
/** Provides a functional approach to handling protocol state. */
data class State(val value: S, val result: A) {
fun map(f: (A) -> B) = State(value, f(result))
@Suppress("UNCHECKED_CAST")
fun state(): T? = value as? T
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy