package ca.ksamad.encore.mpd

/** Lifecycle of an [MpdClient]'s link to a server, surfaced as observable state. */
sealed interface MpdConnectionState {
    /** No connection; the initial and post-[MpdClient.disconnect] state. */
    data object Disconnected : MpdConnectionState

    /** A connection attempt is in flight. */
    data object Connecting : MpdConnectionState

    /** Both the command and idle connections are up and the idle loop is running. */
    data object Connected : MpdConnectionState

    /** The connection dropped or failed; [message] describes why. */
    data class Error(val message: String) : MpdConnectionState
}
