lustre_omnistate

Types

pub type EncoderDecoder(
  encoded_omnistate,
  omnistate,
  encoded_msg,
  msg,
  decode_error,
) {
  EncoderDecoder(
    msg_encoder: fn(msg) -> Result(encoded_msg, Nil),
    omnistate_decoder: fn(encoded_omnistate) ->
      Result(omnistate, decode_error),
  )
}

Constructors

  • EncoderDecoder(
      msg_encoder: fn(msg) -> Result(encoded_msg, Nil),
      omnistate_decoder: fn(encoded_omnistate) ->
        Result(omnistate, decode_error),
    )
pub type OmniMessage(omnistate, decode_error) {
  OmnistateReceived(
    Result(omnistate, OmnistateError(decode_error)),
  )
  TransportUp
  TransportDown(code: Int, message: String)
  TransportInitError(message: String)
}

Constructors

  • OmnistateReceived(
      Result(omnistate, OmnistateError(decode_error)),
    )
  • TransportUp
  • TransportDown(code: Int, message: String)
  • TransportInitError(message: String)
pub type OmnistateError(decode_error) {
  DecodeErrors(decode_error)
}

Constructors

  • DecodeErrors(decode_error)

Functions

pub fn setup(
  init: fn(a) -> #(b, Effect(c)),
  update: fn(d, e) -> #(d, Effect(e)),
  transport: Transport(f, g, h, i),
  wrapper: fn(OmniMessage(j, k)) -> c,
  encoder_decoder: EncoderDecoder(g, j, f, e, k),
) -> #(fn(a) -> #(b, Effect(c)), fn(d, e) -> #(d, Effect(e)))
Search Document