package lt-code

  1. Overview
  2. Docs

Module Lt_codeSource

Constants

Sourceval max_data_block_count : int
Sourceval max_drop_count : int

Basic types

Sourcemodule Param : sig ... end
Sourcetype drop
Sourceval data_of_drop : drop -> Cstruct.t
Sourcemodule Drop_set : Set.S with type elt = drop

Encoding

Sourcetype encode_error = [
  1. | `Inconsistent_data_block_size
  2. | `Invalid_drop_count
  3. | `Invalid_data_block_count
  4. | `Invalid_systematic_scaling_factor
  5. | `Invalid_drop_data_buffer
]

Basic

Sourceval encode : ?systematic_scaling_factor:float -> ?systematic:bool -> ?drop_data_buffer:Cstruct.t array -> max_drop_count:int -> Cstruct.t array -> (Param.t * drop array, encode_error) result

Advanced

Sourcetype encoder
Sourceval create_encoder : ?drop_data_buffer:Cstruct.t array -> Param.t -> Cstruct.t array -> (encoder, encode_error) result
Sourceval reset_encoder : encoder -> unit
Sourceval param_of_encoder : encoder -> Param.t
Sourceval encoder_is_systematic : encoder -> bool
Sourceval data_block_count_of_encoder : encoder -> int
Sourceval max_drop_count_of_encoder : encoder -> int
Sourceval data_block_size_of_encoder : encoder -> int
Sourceval data_blocks_of_encoder : encoder -> Cstruct.t array
Sourceval encode_one : encoder -> drop option
Sourceval encode_all : encoder -> drop array

Decoding

Sourcetype decode_error = [
  1. | `Invalid_drop_index
  2. | `Invalid_drop_degree
  3. | `Invalid_drop_count
  4. | `Invalid_data_block_buffer
  5. | `Invalid_data_block_size
  6. | `Invalid_drop_size
  7. | `Cannot_recover
]

Basic

Sourceval decode : ?data_block_buffer:Cstruct.t array -> Param.t -> Drop_set.t -> (Cstruct.t array, decode_error) result

Advanced

Sourcetype decoder
Sourceval create_decoder : ?data_block_buffer:Cstruct.t array -> data_block_size:int -> Param.t -> (decoder, decode_error) result
Sourceval reset_decoder : decoder -> unit
Sourceval param_of_decoder : decoder -> Param.t
Sourceval decoder_is_systematic : decoder -> bool
Sourceval data_block_count_of_decoder : decoder -> int
Sourceval max_drop_count_of_decoder : decoder -> int
Sourceval data_block_size_of_decoder : decoder -> int
Sourceval drop_fill_count_of_decoder : decoder -> int
Sourceval data_blocks_of_decoder : decoder -> Cstruct.t array option
Sourcetype decode_status = [
  1. | `Success of Cstruct.t array
  2. | `Ongoing
]
Sourceval decode_all : decoder -> Drop_set.t -> (Cstruct.t array, decode_error) result