package hiredis-value

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Hiredis_valueSource

Hiredis_value provides access to the RESP value type

Sourcetype t =
  1. | Nil
  2. | Error of string
  3. | Integer of int64
  4. | String of string
  5. | Array of t array
  6. | Status of string
Sourceval nil : t

Get a nil value

Sourceval string : string -> t

Convert an OCaml string to a Hiredis string

Sourceval int64 : int64 -> t

Convert an int64 to Hiredis number

Sourceval int : int -> t

Convert an int to Hiredis number

Sourceval array : t array -> t

Convert an OCaml array to Hiredis array

Sourceval error : string -> t

Create an error value

Sourceval status : string -> t

Create a status or "simple string" value

Sourceexception Invalid_value
Sourceval is_nil : t -> bool
Sourceval is_error : t -> bool
Sourceval to_string : t -> string

to_string v converts v to a string, otherwise Invalid_value is raised

Sourceval to_int64 : t -> int64

to_int64 v converts v to an int64, otherwise Invalid_value is raised

Sourceval to_int : t -> int

to_int v converts v to an int, otherwise Invalid_value is raised

Sourceval to_float : t -> float

to_float v converts v to a float, otherwise Invalid_value is raised

Sourceval to_array : t -> t array

to_array v converts v to an array of values if v is an array value, * otherwise Invalid_value is raised

Sourceval to_list : t -> t list

to_list v converts v to a list of values if v is an array value, * otherwise Invalid_value is raised

Sourceval to_hashtbl : t -> (string, t) Hashtbl.t

to_hashtbl v converts v to a Hashtbl.t if v is an array value and * the array can be interpreted as a hash table, otherwise Invalid_value is * raised

OCaml

Innovation. Community. Security.