package scid

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

Module Scid.ESource

Sourcetype dst =
  1. | Channel of out_channel
  2. | Buffer of Buffer.t
  3. | Manual
    (*

    The type for output destinations.

    *)
Sourcetype t

The type for R encoders.

Sourceval make : dst -> t

encoder dst is an encoder that outputs to dst.

Sourcetype encode =
  1. | Await
  2. | End
  3. | R of R.t
Sourceval encode : t -> encode -> [ `Ok | `Partial ]

encode e v is :

  • `Partial iff e has a `Manual destination and needs more output storage. The client must use Manual.dst to provide a new buffer and then call encode with `Await until `Ok is returned.
  • `Ok when the encoder is ready to encode a new `R or `End.

For `Manual destinations, encoding `End always returns `Partial, continue with `Await until `Ok is returned at which point Manual.dst_rem e is guaranteed to be the size of the last provided buffer (i.e. nothing was written).

Raises. Invalid_argument if a non well-formed sequence of lexemes is encoded or if a `Lexeme or `End is encoded after a `Partial encode.

Sourcemodule Manual : sig ... end

Manual destinations.