package core

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

Utility functions for marshalling to and from bigstring, extending Core_kernel.Bigstring_marshal.

include module type of struct include Core_kernel.Bigstring_marshal end
val marshal_blit : ?flags:Marshal.extern_flags Base.List.t -> _ -> ?pos:Base.Int.t -> ?len:Base.Int.t -> Core_kernel.Bigstring.t -> Base.Int.t

Marshals value _ to the bigstring at most len bytes.

val marshal : ?flags:Marshal.extern_flags Base.List.t -> _ -> Core_kernel.Bigstring.t

Marshals value _ to a new bigstring. This function may need two times more memory than marshal_blit.

  • parameter flags

    default = []

val marshal_data_size : ?pos:Base.Int.t -> Core_kernel.Bigstring.t -> Base.Int.t

The length of marshalled data in the bigstring

val unmarshal : ?pos:Base.Int.t -> Core_kernel.Bigstring.t -> _

Unmarshals a value from the bigstring and/or returns the index of the byte in the bigstring right after the unmarshalled value.

val unmarshal_next : ?pos:Base.Int.t -> Core_kernel.Bigstring.t -> _ * Base.Int.t
val marshal_to_fd : ?buf:Core_kernel.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.

val marshal_to_sock_no_sigpipe : (?buf:Core_kernel.Bigstring.t -> ?flags:Marshal.extern_flags list -> Unix.file_descr -> 'a -> unit) Core_kernel.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.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.

OCaml

Innovation. Community. Security.