Crate libdonet

source ·
Expand description

You can return to the Donet manual at docs.donet-server.org.

§libdonet

Provides the necessary utilities and definitions for using the Donet networking protocol.

These utilities include a lexer, parser, and high-level representation of the parsed DC file, as well as creating datagrams, iterating through datagrams, and the definition of every message type in the Donet protocol.

§Getting Started

The recommended way to get started is to enable all features. Do this by enabling the full feature flag:

libdonet = { version = "0.1.0", features = ["full"] }

§Feature Flags

The crate provides a set of feature flags to reduce the amount of compiled code. It is possible to just enable certain features over others. Below is a list of the available feature flags.

  • full: Enables all feature flags available for libdonet.
  • datagram: Includes Datagram / Datagram Iterator source for writing network packets.
  • dcfile: Includes the DC file lexer, parser, and DC element structures.

Modules§

  • Data model of the DC Array element, which is a parameter type that stores a list of values of the same data type.
  • Data model for a DC Atomic Field, which represents a remote procedure call method of a Distributed Class.
  • Base data model for DC Field elements. Alone, it represents an attribute of a structure or Distributed Class.
  • Root structure that stores the collection of DC elements in memory. Provides functions for manipulating the tree.
  • Representation of arbitrary and historical keywords as defined in the DC file.
  • Data model for Distributed Class definitions in the DC file. Stores DC Fields and tracks class hierarchy.
  • Data model for a DC Molecular field, which represents a form of a field ‘alias’ for a collection of fields.
  • Structure representing data types supported in the DC language and enforcing numeric limits through constraints.
  • Data model that represents a single parameter of an atomic field, which together form a RPC method signature.
  • Data model representing a DC Struct element. [NEEDS WORK]
  • Represents all data types supported by the DC language and developer-defined type alias definitions.
  • Includes definitions of type aliases for Donet concepts, and the full definition of the network protocol message types.
  • hashgen 🔒
    Prime Number Generator and 32-bit DC File Hash generator based off Panda3D.
  • parser 🔒
    Module of libdonet that contains the Context Free Grammar definition of the DC file language, the process of generating the DC file Abstract Syntax Tree, and the process of converting the AST into the final DC file class hierarchy structure that is used by the Donet daemon at runtime to be able to interpret network messages that follow the network contract defined in the DC file(s).

Functions§

  • Creates a pretty_env_logger logger if no log logger is found to be initialized in this process.
  • Returns false if a log logger is not initialized.
  • Front end to the libdonet DC parser pipeline.
  • Easy to use interface for the DC file parser. Handles reading the DC files, instantiating the DC parsing pipeline, and either returns the DCFile object or a Parse/File error.