Trait BinDisplay

Source
pub trait BinDisplay {
    type BinEntry;

    // Required methods
    fn display_bin_iter(&self) -> Box<dyn Iterator<Item = Self::BinEntry> + '_>;
    fn write_bin<W: Write>(entry: &Self::BinEntry, writer: W) -> Result<()>;
    fn write_header<W: Write>(&self, writer: W) -> Result<()>;
}
Expand description

§Trait used to display bins

  • This is, e.g., used by the glue writers to write the bins of the merged results

Required Associated Types§

Source

type BinEntry

What type does the displayable BinEntry have?

Required Methods§

Source

fn display_bin_iter(&self) -> Box<dyn Iterator<Item = Self::BinEntry> + '_>

§Iterator over all the bins
  • you might require to use this if you are working with generics
  • if you are working with a specific type there is usually a more efficient implementation that did not require the usage of dynamic traits (dyn) and that are thus more efficient, consider using those instead
Source

fn write_bin<W: Write>(entry: &Self::BinEntry, writer: W) -> Result<()>

§For writing a bin
  • How to write a bin to a file? If a bin consists, e.g., of an exclusive and inclusive border this might require the writing of two values. It could also be a single value instead. It should be something the user expects from your binning, see write header
Source

fn write_header<W: Write>(&self, writer: W) -> Result<()>

§Writing the header of the bin
  • This is intended to name, e.g., a column in a file. Output could be “SingleBin” or “BinBorderExclusive BinBorderInclusive” and so on

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§