Function zet::operations::calculate
source · pub fn calculate<O: LaterOperand>(
operation: OpName,
log_type: LogType,
first_operand: &[u8],
rest: impl ExactSizeIterator<Item = Result<O>>,
out: impl Write
) -> Result<()>
Expand description
Calculates and prints the set operation named by operation
. Each file in files
is treated as a set of lines:
OpName::Union
prints the lines that occur in any file,OpName::Intersect
prints the lines that occur in all files,OpName::Diff
prints the lines that occur in the first file and no other,OpName::Single
prints the lines that occur once in exactly in the input,OpName::Multiple
prints the lines that occur more than once in the input,OpName::SingleByFile
prints the lines that occur in exactly one file, andOpName::MultipleByFile
prints the lines that occur in more than one file.
The log_type
operand specifies whether calculate
should print the number
of times each line appears in the input (LogType::Lines
), the number of
files in which each line appears (LogType::Files
), or neither
(LogType::None
).