Swim.Codec

swim · API reference

val encode_ping : Types.Wire.ping -> Msgpck.t
val decode_ping : Msgpck.t -> (Types.Wire.ping, string) result
val encode_indirect_ping : Types.Wire.indirect_ping_req -> Msgpck.t
val decode_indirect_ping : 
  Msgpck.t ->
  (Types.Wire.indirect_ping_req, string) result
val encode_ack : Types.Wire.ack_resp -> Msgpck.t
val decode_ack : Msgpck.t -> (Types.Wire.ack_resp, string) result
val encode_nack : Types.Wire.nack_resp -> Msgpck.t
val decode_nack : Msgpck.t -> (Types.Wire.nack_resp, string) result
val encode_suspect : Types.Wire.suspect -> Msgpck.t
val decode_suspect : Msgpck.t -> (Types.Wire.suspect, string) result
val encode_alive : Types.Wire.alive -> Msgpck.t
val decode_alive : Msgpck.t -> (Types.Wire.alive, string) result
val encode_dead : Types.Wire.dead -> Msgpck.t
val decode_dead : Msgpck.t -> (Types.Wire.dead, string) result
val encode_compress : Types.Wire.compress -> Msgpck.t
val decode_compress : Msgpck.t -> (Types.Wire.compress, string) result
val wire_msg_to_msgpck : 
  Types.Wire.protocol_msg ->
  Types.Wire.message_type * Msgpck.t
val encode_msg_to_cstruct : 
  Types.Wire.protocol_msg ->
  buf:Cstruct.t ->
  (int, [ `Buffer_too_small ]) result
val decode_msg_from_cstruct : 
  Cstruct.t ->
  (Types.Wire.protocol_msg, Types.decode_error) result
val crc32_table : int32 array
val crc32_cstruct : Cstruct.t -> int32
val add_crc_to_cstruct : 
  src:Cstruct.t ->
  src_len:int ->
  dst:Cstruct.t ->
  (int, [ `Buffer_too_small ]) result
val verify_and_strip_crc : Cstruct.t -> (Cstruct.t, Types.decode_error) result
val add_label_to_cstruct : 
  label:string ->
  src:Cstruct.t ->
  src_len:int ->
  dst:Cstruct.t ->
  (int, [ `Buffer_too_small ]) result
val strip_label : Cstruct.t -> (Cstruct.t * string, Types.decode_error) result
val encode_compound_to_cstruct : 
  msgs:Cstruct.t list ->
  msg_lens:int list ->
  dst:Cstruct.t ->
  (int, [ `Buffer_too_small ]) result
val decode_compound_from_cstruct : 
  Cstruct.t ->
  (Cstruct.t list * int, Types.decode_error) result
val encode_internal_msg_to_cstruct : 
  self_name:string ->
  self_port:int ->
  Types.protocol_msg ->
  buf:Cstruct.t ->
  (int, [ `Buffer_too_small ]) result
val decode_internal_msg_from_cstruct : 
  default_port:int ->
  Cstruct.t ->
  (Types.protocol_msg, Types.decode_error) result
val encode_packet : 
  Types.packet ->
  buf:Cstruct.t ->
  (int, [ `Buffer_too_small ]) result
val decode_packet : Cstruct.t -> (Types.packet, Types.decode_error) result
val encoded_size : Types.protocol_msg -> int
val encode_internal_msg : 
  self_name:string ->
  self_port:int ->
  Types.protocol_msg ->
  string
val add_crc : string -> string
val verify_and_strip_crc_string : string -> (string, Types.decode_error) result
val add_label : string -> string -> string
val strip_label_string : string -> (string * string, Types.decode_error) result
val make_compound_msg : string list -> string
val decode_compound_msg : 
  string ->
  (string list * int, Types.decode_error) result
val encode_push_pull_header : Types.Wire.push_pull_header -> Msgpck.t
val decode_push_pull_header : 
  Msgpck.t ->
  (Types.Wire.push_pull_header, string) result
val encode_push_node_state : Types.Wire.push_node_state -> Msgpck.t
val decode_push_node_state : 
  Msgpck.t ->
  (Types.Wire.push_node_state, string) result
val encode_push_pull_msg : 
  header:Types.Wire.push_pull_header ->
  nodes:Types.Wire.push_node_state list ->
  user_state:string ->
  string
val decode_push_pull_msg : 
  string ->
  (Types.Wire.push_pull_header * Types.Wire.push_node_state list * string,
    Types.decode_error)
    result
val decode_compress_from_cstruct : 
  Cstruct.t ->
  (int * Cstruct.t, Types.decode_error) result
val decode_push_pull_msg_cstruct : 
  Cstruct.t ->
  (Types.Wire.push_pull_header * Types.Wire.push_node_state list * Cstruct.t,
    Types.decode_error)
    result