Module ical::line

source ·
Expand description

Read and unfold a line from a BufRead.

Individual lines within vCard are delimited by the [RFC5322] line break, which is a CRLF sequence (U+000D followed by U+000A). Long logical lines of text can be split into a multiple-physical-line representation using the following folding technique. Content lines SHOULD be folded to a maximum width of 75 octets, excluding the line break. Multi-octet characters MUST remain contiguous. The rationale for this folding process can be found in [RFC5322], Section 2.1.1.

A logical line MAY be continued on the next physical line anywhere between two characters by inserting a CRLF immediately followed by a single white space character (space (U+0020) or horizontal tab (U+0009)). The folded line MUST contain at least one character. Any sequence of CRLF followed immediately by a single white space character is ignored (removed) when processing the content type.

Examples

[dependencies.ical]
version = "0.3.*"
default-features = false
features = ["line-reader"]
extern crate ical;

use std::io::BufReader;
use std::fs::File;

let buf = BufReader::new(File::open("./tests/ressources/vcard_input.vcf").unwrap());

let reader = ical::LineReader::new(buf);

for line in reader {
    println!("{}", line);
}

Structs

An unfolded raw line.
Take a BufRead and return the unfolded Line.

Traits

A trait generic for implementing line reading use by PropertyParser.