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
A STREAM-START event.
StreamEnd
A STREAM-END event.
DocumentStart
Fields
version: Option<VersionDirective>
Optional version directive.
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
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
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
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
sourceimpl Event
impl Event
sourcepub fn from_raw(raw: yaml_event_t) -> Result<Self, EventError>
pub fn from_raw(raw: yaml_event_t) -> Result<Self, EventError>
Take ownership of a raw yaml_event_t
. This method frees the allocated
memory, even if the conversion fails.
sourcepub fn into_raw(self) -> Result<yaml_event_t, EventError>
pub fn into_raw(self) -> Result<yaml_event_t, EventError>
Return the raw yaml_event_t
for this event. The caller is responsible
for freeing memory.
Trait Implementations
impl Eq for Event
impl StructuralEq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more