Module dsi_bitstream::codes::params

source ·
Expand description

Mechanisms for selecting parameters.

Traits and structures in this file are of no interest for the standard user. Their purpose is to provide a systematic way, and in particular a default way, to select parameters for parameterized traits such as GammaReadParam and GammaWriteParam.

The traits and structure in this module work closely with the bitstream readers and writers in impls, which have an additional type parameter RP/WP that must implement marker traits ReadParams or WriteParams, respectively. The type is then used as a selector type to provide blanket implementations of parameterless traits in codes such as GammaRead, GammaWrite, DeltaRead, DeltaWrite, and so on.

This module provides default selector types DefaultReadParams and DefaultWriteParams which are also the default value for the parameter RP/WP in the bitstream readers and writers in crate::impls. Type-selected blanket implementations of all parameterless traits in crate::codes are provided for the bitstream readers and writers in impls. Thus, if you not specify a value for the parameter RP/WP, you will obtain automatically the blanket implementations for parameterless traits contained in this module.

However, you can also create new selector types implementing ReadParams/WriteParams and write blanket implementations for the bitstream readers and writers in crate::impls where RP/WP is set to your selector types. Then, by specifying your type as value of the parameter RP/WP when creating such readers and writers you will use automatically your blanket implementations instead of the ones provided by this module.

Structs§

Traits§

  • Marker trait for read-parameters selector types.
  • Marker trait for write-parameters selector types.