[][src]Module cotton::prelude

Re-exports

pub use structopt::StructOpt;
pub use log;
pub use crate::loggerv;

Modules

__std_iter

Composable external iteration.

fmt

Utilities for formatting and printing Strings.

structs

The concrete iterator types.

Macros

debug

Logs a message at the debug level.

error

Logs a message at the error level.

info

Logs a message at the info level.

iproduct

Create an iterator over the “cartesian product” of iterators.

izip

Create an iterator running multiple iterators in lockstep.

log_enabled

Determines if a message logged at the specified level in that module will be logged.

trace

Logs a message at the trace level.

warn

Logs a message at the warn level.

Structs

BufReader

The BufReader struct adds buffering to any reader.

BufWriter

Wraps a writer and buffers its output.

DryRunOpt
File

A reference to an open file on the filesystem.

LoggingOpt
Problem

Wraps error, context and backtrace information and formats it for display. Data is heap allocated to avoid type parameters or lifetimes.

Enums

Diff

A type returned by the diff_with function.

Either

The enum Either with variants Left and Right is a general purpose sum type with two cases.

EitherOrBoth

Value that either holds a single A or B, or both.

FoldWhile

An enum used for controlling the execution of .fold_while().

MinMaxResult

MinMaxResult is an enum returned by minmax. See Itertools::minmax() for more detail.

Position

A value yielded by WithPosition. Indicates the position of this element in the iterator results.

Traits

Boolinator

This trait defines a number of combinator-style methods for use with bool values.

BufRead

A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.

Debug

? formatting.

Display

Format trait for an empty format, {}.

FailedTo

Extension of Result that allows program to panic with Display message on Err for fatal application errors that are not bugs

FailedToIter

Convert Iterator of Result<O, E> to iterator of O and panic on first E with problem message

Itertools

An Iterator blanket implementation that provides extra adaptors and methods.

MapProblem

Map type containing error to type containing Problem

MapProblemOr

Map type not containing any error to type containing given Problem

OkOrLog

Extension of Result that allows program to log on Err with Display message for application errors that are not critical

OkOrLogIter

Convert Iterator of Result<O, E> to iterator of Option<O> and log any Err variants

OkOrProblem

Extension trait to map Option to Result with Problem

PeekingNext

An iterator that allows peeking at an element before deciding to accept it.

ProblemWhile

Convert to Problem if needed and add context to it

Read

The Read trait allows for reading bytes from a source.

StructOpt

A struct that is converted from command line arguments.

TapBooleanOps

Tap operations for bool.

TapOps

Tap operations for all types.

TapOptionOps

Tap operations for Option.

TapResultOps

Tap operations for Result.

Write

A trait for objects which are byte-oriented sinks.

Functions

assert_equal

Assert that two iterables produce equal sequences, with the same semantics as equal(a, b).

concat

Combine all an iterator's elements into one element by using Extend.

cons_tuples

Create an iterator that maps for example iterators of ((A, B), C) to (A, B, C).

diff_with

Compares every element yielded by both i and j with the given function in lock-step and returns a Diff which describes how j differs from i.

equal

Return true if both iterables produce equal sequences (elements pairwise equal and sequences of the same length), false otherwise.

in_context_of

Executes closure with problem_while context

in_context_of_with

Executes closure with problem_while_with context

init_logger
iterate

Creates a new iterator that infinitely applies function to value and yields results.

kmerge_by

Create an iterator that merges elements of the contained iterators.

multizip

An iterator that generalizes .zip() and allows running multiple iterators in lockstep.

partition

Partition a sequence using predicate pred so that elements that map to true are placed before elements which map to false.

process_results

“Lift” a function of the values of an iterator so that it can process an iterator of Result values instead.

read_stdin
repeat_callDeprecated

An iterator source that produces elements indefinitely by calling a given closure.

repeat_n

Create an iterator that produces n repetitions of element.

stdin

Constructs a new handle to the standard input of the current process.

stdout

Constructs a new handle to the standard output of the current process.

unfold

Creates a new unfold source with the specified closure as the "iterator function" and an initial state to eventually pass to the closure