module MrMime_input:sig..end
type'at ='a RingBuffer.Committed.t
typest =Internal_buffer.st=
| |
St |
(* |
A proof to use a
(char, int8_unsigned_elt, c_layout) Bigarray.Array1.t | *) |
string internallytypebs =Internal_buffer.bs=
| |
Bs |
val write : 'a t -> 'a Internal_buffer.t -> int -> int -> unitwrite input buf off len writes an internal buffer (with the same proof
'a - see MrMime_input.st or MrMime_input.bs) starting at off to len inside the input.val write_string : 'a t -> string -> int -> int -> unitwrite_string input buf off len writes a string starting at off to
len inside the input.val create_bytes : int -> st tcreate_bytes size returns a fresh input of length size with the proof MrMime_input.st.
The sequence is uninitialiazed and contains arbitrary bytes.val create_bigstring : int -> bs tcreate_bigstring size returns a fresh input of length size with the
proof MrMime_input.bs. The sequence is unintialiazed and contains arbitrary bytes.val size : 'a t -> intsize input returns the length of the given input.val peek : 'a t -> 'a Internal_buffer.t -> int -> int -> unit
val read : 'a t -> 'a Internal_buffer.t -> int -> int -> unitread input buf off len read the data inside the input and advance the read
pointer.val read_space : 'a t -> ('a Internal_buffer.t * int * int) optionread_space input returns a continuous part of the internal buffer with the
offset and the length of bytes available to read. If MrMime_input.ravailable
returns 0, read_space returns None.
The continuous part of the internal buffer is not necessarily a buffer which
contains all bytes available to read (it's a part).
val write_space : 'a t -> ('a Internal_buffer.t * int * int) optionwrite_space input returns a continuous part of the internal buffer with
the offset and the length of bytes available to write. If
MrMime_input.wavailable returns 0, write_space returns None.
The continuous part of the internal buffer is not necessarily a buffer which
contains all bytes available to write (it's a part).
val transmit : 'a t -> ('a Internal_buffer.t -> int -> int -> int) -> inttransmit input f same as Option.map f (read_space input).val ravailable : 'a t -> intravailable input returns available bytes to read.val wavailable : 'a t -> intwavailable input returns available bytes to write.val radvance : 'a t -> int -> unitradvance input n drops n bytes.val wadvance : 'a t -> int -> unitwadvance input n advances the write pointer.val get : 'a t -> charget input gets the first character at the read pointer.val pp : Format.formatter -> 'a t -> unitpp input prints an human readable representation of input.val proof : 'a t -> 'a Internal_buffer.tproof input gets the internal buffer with the proof.val savailable : 'a t -> intsavailable input returns available bytes to read or, if the input is
committed, returns available bytes from the commit to the write pointer.