[][src]Function sonnerie::formatted::add_from_stream

pub fn add_from_stream<R: BufRead>(
    tx: &mut CreateTx,
    db: &DatabaseReader,
    format: &str,
    input: &mut R,
    timestamp_format: Option<&str>,
    nocheck: bool
) -> Result<(), WriteFailure>

Read keys from a text stream and insert it into a transaction

Parameters:

  • tx - a transaction to write into
  • db - the database that is type-checked against
  • format - the format of each row. If each row contains its own format, you can instead use add_from_stream_with_fmt.
  • input - a text stream to read from, the keys are formatted as label timestamp value [value ...]. Whitespace is escaped with a backslash.
  • timestamp - the strftime-like format to parse timestamps as. If None, use epoch nanos.
  • nocheck - turns off slow type checking (with db).