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,
}
Expand description

Emitter or parser event.

Variants

StreamStart

Fields

encoding: Option<Encoding>

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

A STREAM-START event.

StreamEnd

A STREAM-END event.

DocumentStart

Fields

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.

A DOCUMENT-START event.

DocumentEnd

Fields

implicit: bool

If true, no document end marker will be emitted.

A DOCUMENT-END event.

Alias

Fields

anchor: String

Target anchor name.

An ALIAS event.

Scalar

Fields

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.

A SCALAR event.

SequenceStart

Fields

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.

A SEQUENCE-START event.

SequenceEnd

A SEQUENCE-END event.

MappingStart

Fields

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.

A MAPPING-START event.

MappingEnd

A MAPPING-END event.

Implementations

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

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.