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
A DOCUMENT-START event.
Fields
§
version: Option<VersionDirective>Optional version directive.
List of tag directives, can be empty.
DocumentEnd
A DOCUMENT-END event.
Alias
An ALIAS event.
Scalar
A SCALAR event.
Fields
§
style: Option<ScalarStyle>Scalar style; if None, LibYAML will choose a style.
SequenceStart
A SEQUENCE-START event.
Fields
§
style: Option<SequenceStyle>Sequence style; if None, LibYAML will choose a style.
SequenceEnd
A SEQUENCE-END event.
MappingStart
A MAPPING-START event.
Fields
§
style: Option<MappingStyle>Mapping style; if None, LibYAML will choose a style.
MappingEnd
A MAPPING-END event.
Implementations§
Source§impl 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 StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more