[][src]Enum libyaml::Event

pub enum Event {
    StreamStart {
        encoding: Option<Encoding>,
    },
    StreamEnd,
    DocumentStart {
        version: Option<VersionDirective>,
        tags: Vec<TagDirective>,
        implicit: bool,
    },
    DocumentEnd {
        implicit: bool,
    },
    Alias {
        anchor: String,
    },
    Scalar {
        anchor: Option<String>,
        tag: Option<String>,
        value: String,
        plain_implicit: bool,
        quoted_implicit: bool,
        style: Option<ScalarStyle>,
    },
    SequenceStart {
        anchor: Option<String>,
        tag: Option<String>,
        implicit: bool,
        style: Option<SequenceStyle>,
    },
    SequenceEnd,
    MappingStart {
        anchor: Option<String>,
        tag: Option<String>,
        implicit: bool,
        style: Option<MappingStyle>,
    },
    MappingEnd,
}

Emitter or parser event.

Variants

StreamStart

A STREAM-START event.

Fields of StreamStart

encoding: Option<Encoding>

Stream encoding; if None, LibYAML will choose an encoding.

StreamEnd

A STREAM-END event.

DocumentStart

A DOCUMENT-START event.

Fields of DocumentStart

version: Option<VersionDirective>

Optional version directive.

tags: Vec<TagDirective>

List of tag directives, can be empty.

implicit: bool

If true, no document start marker will be emitted.

DocumentEnd

A DOCUMENT-END event.

Fields of DocumentEnd

implicit: bool

If true, no document end marker will be emitted.

Alias

An ALIAS event.

Fields of Alias

anchor: String

Target anchor name.

Scalar

A SCALAR event.

Fields of Scalar

anchor: Option<String>

Optional anchor name.

tag: Option<String>

Optional tag name.

value: String

Scalar value.

plain_implicit: bool

If true, no tag will be emitted for the plain style.

quoted_implicit: bool

If true, no tag will be emitted for the non-plain styles.

style: Option<ScalarStyle>

Scalar style; if None, LibYAML will choose a style.

SequenceStart

A SEQUENCE-START event.

Fields of SequenceStart

anchor: Option<String>

Optional anchor name.

tag: Option<String>

Optional tag name.

implicit: bool

If true, no tag will be emitted.

style: Option<SequenceStyle>

Sequence style; if None, LibYAML will choose a style.

SequenceEnd

A SEQUENCE-END event.

MappingStart

A MAPPING-START event.

Fields of MappingStart

anchor: Option<String>

Optional anchor name.

tag: Option<String>

Optional tag name.

implicit: bool

If true, no tag will be emitted.

style: Option<MappingStyle>

Mapping style; if None, LibYAML will choose a style.

MappingEnd

A MAPPING-END event.

Methods

impl Event[src]

pub fn from_raw(raw: yaml_event_t) -> Result<Self, EventError>[src]

Take ownership of a raw yaml_event_t. This method frees the allocated memory, even if the conversion fails.

pub fn into_raw(self) -> Result<yaml_event_t, EventError>[src]

Return the raw yaml_event_t for this event. The caller is responsible for freeing memory.

Trait Implementations

impl Clone for Event[src]

impl Eq for Event[src]

impl PartialEq<Event> for Event[src]

impl Debug for Event[src]

impl Hash for Event[src]

Auto Trait Implementations

impl Send for Event

impl Sync for Event

impl Unpin for Event

impl UnwindSafe for Event

impl RefUnwindSafe for Event

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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