package wire

  1. Overview
  2. Docs

Module Everparse.RawSource

Escape hatch for manual 3D authoring.

These constructors exist for EverParse features that currently have no codec-level equivalent. Most users should stay on the Field/Codec path and use struct_of_codec or schema.

Sourcetype nonrec struct_ = struct_
Sourcetype field = Field.packed
Sourcetype nonrec decl = decl
Sourcetype nonrec decl_case = decl_case
Sourcetype nonrec module_ = module_
Sourcetype nonrec t = t
Sourceval typedef : ?entrypoint:bool -> ?export:bool -> ?output:bool -> ?extern_:bool -> ?doc:string -> struct_ -> decl

Top-level typedef declaration.

Sourceval define : string -> int -> decl

Top-level integer definition.

Sourceval extern_fn : string -> param list -> 'a typ -> decl

External function declaration used by 3D actions.

Sourceval extern_probe : ?init:bool -> string -> decl

External probe declaration.

Sourceval enum_decl : string -> (string * int) list -> 'a typ -> decl

Top-level enum declaration.

Sourceval decl_case : int -> 'a typ -> decl_case

One tagged case in a top-level casetype declaration.

Sourceval decl_default : 'a typ -> decl_case

Default case in a top-level casetype declaration.

Sourceval casetype_decl : string -> param list -> 'a typ -> decl_case list -> decl

Top-level casetype declaration.

Sourceval module_ : ?doc:string -> decl list -> module_

Builds a 3D module from declarations.

Sourceval to_3d : module_ -> string

Renders a 3D module to text.

Sourceval to_3d_file : string -> module_ -> unit

Writes a rendered 3D module to a file.

Sourceval field : string -> ?constraint_:bool expr -> ?action:Action.t -> 'a typ -> field

Named field. Returns a packed Field.t.

Sourceval anon_field : 'a typ -> field

Anonymous field in a 3D struct.

Sourceval field_ref : field -> int expr

field_ref f returns the expression referencing field f by name. The field must have been created with field (not anon_field).

Sourceval struct_ : string -> field list -> struct_

Non-parameterised 3D struct.

Sourceval struct_name : struct_ -> string

Name of a struct declaration.

Sourceval field_names : struct_ -> string list

Named field names in declaration order.

Sourcetype ocaml_kind =
  1. | K_int
  2. | K_int64
  3. | K_bool
  4. | K_string
  5. | K_unit
    (*

    The OCaml representation kind of a field (for FFI stub generation).

    *)
Sourceval field_kinds : struct_ -> (string * ocaml_kind) list

Named field names with their OCaml type kind.

Sourceval struct_project : struct_ -> name:string -> keep:Field.packed list -> struct_

struct_project s ~name ~keep returns a copy of s renamed to name keeping only the fields in keep. All others become anonymous.

Sourceval struct_params : struct_ -> param list

Formal parameters of a struct (empty for non-parameterised structs).

Sourceval struct_typ : struct_ -> unit typ

View a 3D struct as a wire description.

Sourceval param : string -> 'a typ -> param

Immutable parameter declaration.

Sourceval mutable_param : string -> 'a typ -> param

Mutable parameter declaration.

Sourceval param_struct : string -> param list -> ?where:bool expr -> field list -> struct_

Parameterised 3D struct.

Sourceval apply : 'a typ -> int expr list -> 'a typ

Apply a parameterised description to integer arguments.

Sourceval type_ref : string -> 'a typ

Unqualified type reference.

Sourceval qualified_ref : string -> string -> 'a typ

Qualified type reference.

Sourceval pp_typ : Format.formatter -> 'a typ -> unit

Pretty-printer for 3D-facing type syntax.

Sourceval pp_module : Format.formatter -> module_ -> unit

Pretty-printer for 3D modules.

Sourceval struct_size : struct_ -> int option

Fixed wire size of a struct, if known statically.

Sourceval of_module : name:string -> module_:module_ -> wire_size:int -> t

Wraps an existing 3D module as a schema.