pub enum Escaper {
V1_0,
Modern,
}parser only.Expand description
The escaping rules to apply, selected by the calendar version.
Variants§
V1_0
vCalendar 1.0 (versit): \; is resolved on read and a backslash before
anything else is literal; writing also escapes a newline, which versit
has none of its own for and which raw would end the line.
Modern
iCalendar 2.0 (RFC 5545 3.3.11): the value escapes \\, \,, \; and
\n, plus the RFC 6868 parameter value encoding.
Implementations§
Source§impl Escaper
impl Escaper
Sourcepub fn for_version(version: IcalVersion) -> Self
pub fn for_version(version: IcalVersion) -> Self
The escaping rules a calendar of version uses.
Sourcepub fn for_version_str(version: &str) -> Self
pub fn for_version_str(version: &str) -> Self
The escaping rules for a raw VERSION wire string (e.g. "1.0").
Sourcepub fn has_param_encoding(self) -> bool
pub fn has_param_encoding(self) -> bool
Whether this version carries the RFC 6868 parameter value encoding, which updates RFC 5545 and so reaches iCalendar 2.0 alone: vCalendar 1.0 predates it, and a caret in one of its parameters is a literal caret.
Sourcepub fn has_param_quoting(self) -> bool
pub fn has_param_quoting(self) -> bool
Whether this version wraps a parameter value carrying a delimiter in
double quotes: RFC 5545 section 3.1 keeps ,, ; and : out of a
bare paramtext and gives quoted-string for a value that needs one,
while vCalendar 1.0 has no such production and reads its double quote
as content.
A different question from has_param_encoding, which is RFC 6868’s
caret encoding, though the two versions this crate knows happen to
answer both the same way.