Module MongoHeader

module MongoHeader: sig .. end
This module defines the header for every message sent to or received from MongoDB.

type t 
type of header

Header creation

val create_header : int -> int32 -> int32 -> MongoOperation.t -> t
create a general header. e.g. create_header body_len request_id response_to op
val create_request_header : int -> int32 -> MongoOperation.t -> t
create a request header. e.g. create_request_header body_len request_id op. The only difference from create_header is that parameter response_to is not necessary here

Values from header

val get_message_len : t -> int32
get the message length out of a header
val get_request_id : t -> int32
get the request id out of a header
val get_response_to : t -> int32
get the response_to id out of a header
val get_op : t -> MongoOperation.t
get the operation out of a header

operations on header

val encode_header : t -> string
encode the header to string, so it can be combined with the message body and sent
val decode_header : string -> t
decode a str (received from MongoDB) to a header
val to_string : t -> string
convert a header to a human readable string