[][src]Enum readme_sync::CMarkItem

pub enum CMarkItem {
    Parsed {
        event: Event<'static>,
        range: Range<usize>,
        text_source: TextSource,
    },
    Created {
        event: Event<'static>,
        note: Cow<'static, str>,
    },
    Modified {
        event: Event<'static>,
        nodes: Box<[Arc<CMarkItem>]>,
        note: Cow<'static, str>,
    },
    Removed {
        nodes: Box<[Arc<CMarkItem>]>,
        note: Cow<'static, str>,
    },
    Noted {
        node: Arc<CMarkItem>,
        note: Cow<'static, str>,
    },
}

An enum that store Markdown event, its origin, and modifications. The event modification tree is stored to improve error messages.

Variants

Parsed

A Markdown event parsed from the specified text source.

Fields of Parsed

event: Event<'static>

Parsed Markdown event.

range: Range<usize>

The corresponding range of the event in the source text.

text_source: TextSource

Text source.

Created

A Markdown event created by data transform functions.

Fields of Created

event: Event<'static>

Created Markdown event.

note: Cow<'static, str>

Data transformation note.

Modified

A Markdown event created from other Markdown events.

Fields of Modified

event: Event<'static>

A Markdown event created from other events.

nodes: Box<[Arc<CMarkItem>]>

Source CMarkItems.

note: Cow<'static, str>

Data transformation note.

Removed

A removed Markdown events.

Fields of Removed

nodes: Box<[Arc<CMarkItem>]>

Removed CMarkItems.

note: Cow<'static, str>

Data transformation note.

Noted

A non-modified Markdown event that noted by data transform function.

Fields of Noted

node: Arc<CMarkItem>

Noted CMarkItem.

note: Cow<'static, str>

Data transformation note.

Implementations

impl<'a> CMarkItem[src]

pub fn new(event: Event<'static>, note: Cow<'static, str>) -> Arc<Self>[src]

Creates CMarkItem with the specified Event and its note.

pub fn from(
    event: Event<'static>,
    range: Range<usize>,
    text_source: TextSource
) -> Arc<Self>
[src]

Creates CMarkItem as an event parsed from the specified text source range.

pub fn event(&self) -> Option<&Event<'static>>[src]

Returns the event or None if it is removed.

pub fn spans(&self) -> Vec<CMarkSpan<'_>>[src]

Returns a Vec of event spans.

Trait Implementations

impl Clone for CMarkItem[src]

impl Debug for CMarkItem[src]

impl PartialEq<CMarkItem> for CMarkItem[src]

impl StructuralPartialEq for CMarkItem[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.