Pdef

nscn.polaris2.pdefgen.Pdef
case class Pdef(name: String, customTypeDefs: VectorMap[String, PdefCustomTypeDef], fields: VectorMap[String, PdefField])

A validated .pdef: the custom types it declares plus its top-level fields, which become a struct called name.

Both maps are insertion-ordered on purpose. A pdef describes a flat binary layout, so the declaration order of the top-level fields IS the wire order - reordering them silently produces a codec that decodes the wrong bytes into the wrong fields. The type defs are ordered for the weaker reason that generated sources should be stable across runs, so an unchanged .pdef does not invalidate downstream build caches.

Keying by name is only lossless because PdefValidator has already rejected duplicate names: a repeated key would silently replace the earlier field.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product