[][src]Function rustsv::parse

pub fn parse<A>(content: A, delimiter: char, has_headers: bool) -> Content

Notable traits for Content

impl Iterator for Content type Item = Entry;
where
    A: Into<String>, 

Parses the provided String into an instance of Content

The method will deconstruct the provided data, turning it into a special, serialization free structure Content

content the CSV data to parse delimiter The delimiter used in the data, for example a pipe (|) or a tab ( ) has_headers If the data's first line contains the titles of each column or not

Examples

Basic usage:

use rustsv::prelude::*;
// Create our input data
let input: &str = "surname,initial,address,phone number\n\
Smith,A,\"14 Made up Drive, Made up City, Ohio\",216-235-3744\n\
Doe,J,\"15 Fake Street, Phonyville, Texas\",210-214-5737";

// Parse the `input` into `Content`
let content: Content = parse(input, ',', true);

assert_eq!(content[0]["surname"], String::from("Smith"))