Module citp::protocol [] [src]

Protocol Types, Readers and Writers.

All CITP protocol types can be written-to and read-from little-endian bytes using the WriteBytes and ReadBytes traits respectively. These traits are implemented for all types implementing the std::io Write and Read traits.

Each layer of the protocol has it's own module. The "Base layer" is specified within this module.

Note that not all types within these modules have a layout that exactly matches the C specification, however the WriteToBytes and ReadFromBytes implementations should match exactly. This is because some types can be much better expressed in rust via the std slice types rather than separate "counter" and array pointer fields which require unsafe blocks to use.

CITP - Base Layer

This module also specifies the base layer as described within the protocol. The base layaer does not define any packages, it merely adds a header that encapsulate all messages.

Reading a Stream.

To read the protocol from a stream of little endian bytes where the received messages are not known ahead of time, the following steps may be followed:

  • Read the full base Header first.
  • Match on the content_type field to determine the next layer to read.
  • Read the header for the second layer.
  • Match on the content_type field of the second layer to determine what type to read.

Modules

finf

CITP/FINF - Fixture Information layer

fptc

CITP/FPTC - Fixture patch layer

fsel

CITP/FSEL - Fixture Selection layer

msex

CITP/MSEX - Media Server Extensions layer

pinf

CITP/PINF - Peer Information Layer

sdmx

The SDMX layer is used to transmit DMX information. CITP supports transmitting a single - wide

Structs

Header

The CITP layer provides a standard, single, header used at the start of all CITP packets.

Traits

ConstSizeBytes

Types that have a constant size when written to or read from bytes.

ReadBytes

A trait for reading any of the CITP protocol types from little-endian bytes.

ReadBytesExt

Extends Read with methods for reading numbers. (For std::io.)

ReadFromBytes

Protocol types that may be read from little endian bytes.

SizeBytes

Types whose size when written to bytes may be determined at runtime.

WriteBytes

A trait for writing any of the CITP protocol types to little-endian bytes.

WriteBytesExt

Extends Write with methods for writing numbers. (For std::io.)

WriteToBytes

Protocol types that may be written to little endian bytes.

Functions

read_new_vec

Read len elements of type T into a new Vec.

read_vec

Read len elements of type T into the given vec.

Type Definitions

LE

A type alias for LittleEndian.

Unions

Kind