Skip to main content

Escaper

Enum Escaper 

Source
pub enum Escaper {
    V1_0,
    Modern,
}
Available on crate feature 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

Source

pub fn for_version(version: IcalVersion) -> Self

The escaping rules a calendar of version uses.

Source

pub fn for_version_str(version: &str) -> Self

The escaping rules for a raw VERSION wire string (e.g. "1.0").

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Escaper

Source§

fn clone(&self) -> Escaper

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Escaper

Source§

impl Debug for Escaper

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Escaper

Source§

fn default() -> Escaper

Returns the “default value” for a type. Read more
Source§

impl Eq for Escaper

Source§

impl PartialEq for Escaper

Source§

fn eq(&self, other: &Escaper) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Escaper

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.