Module Bigstring_marshal

Utility functions for marshalling to and from bigstring

Author Markus Mottl <mmottl@janestreet.com>


val marshal_blit : ?flags:Marshal.extern_flags list -> 'a -> ?pos:int -> ?len:int -> Core_kernel.Bigstring.t -> int
val marshal : ?flags:Marshal.extern_flags list -> 'a -> Core_kernel.Bigstring.t
val marshal_data_size : ?pos:int -> Core_kernel.Bigstring.t -> int
val unmarshal : ?pos:int -> Core_kernel.Bigstring.t -> 'a
val unmarshal_next : ?pos:int -> Core_kernel.Bigstring.t -> 'a * int
val skip : ?pos:int -> Core_kernel.Bigstring.t -> int
val marshal_to_fd : ?buf:Core_kernel.Std.Bigstring.t -> ?flags:Marshal.extern_flags list -> Unix.file_descr -> 'a -> unit

marshal_to_fd ?buf fd v marshals data v to file descriptor fd using marshalling buffer buf, and marshalling flags flags. Raises input errors as in Bigstring.really_write.

Raises [Failure] if buf cannot hold enough data for marshalling.
Param [flags] default = []
Param [buf] default = determined dynamically
val marshal_to_sock_no_sigpipe : (?buf:Core_kernel.Std.Bigstring.t -> ?flags:Marshal.extern_flags list -> Unix.file_descr -> 'a -> unit) Core_kernel.Std.Or_error.t

marshal_to_sock_no_sigpipe ?buf sock v same as marshal_to_fd, but writes to sockets only and uses Bigstring.really_send_no_sigpipe to avoid SIGPIPE on sockets.

val unmarshal_from_sock : ?buf:Core_kernel.Std.Bigstring.t -> Unix.file_descr -> 'a

unmarshal_from_sock ?buf sock unmarshals data from socket sock using unmarshalling buffer buf. Raises input errors as in Bigstring.really_recv.

Raises [Failure] if buf cannot hold enough data for unmarshalling.
Param [buf] default = determined dynamically