pub struct Event {
pub event_type: EventType,
pub position: Position,
}Expand description
Represents a YAML parsing event
Fields§
§event_type: EventTypeThe type of event
position: PositionPosition where the event occurred
Implementations§
Source§impl Event
impl Event
Sourcepub const fn stream_start(position: Position) -> Self
pub const fn stream_start(position: Position) -> Self
Create a stream start event
Sourcepub const fn stream_end(position: Position) -> Self
pub const fn stream_end(position: Position) -> Self
Create a stream end event
Sourcepub const fn document_start(
position: Position,
version: Option<(u8, u8)>,
tags: Vec<(String, String)>,
implicit: bool,
) -> Self
pub const fn document_start( position: Position, version: Option<(u8, u8)>, tags: Vec<(String, String)>, implicit: bool, ) -> Self
Create a document start event
Sourcepub const fn document_end(position: Position, implicit: bool) -> Self
pub const fn document_end(position: Position, implicit: bool) -> Self
Create a document end event
Sourcepub const fn scalar(
position: Position,
anchor: Option<String>,
tag: Option<String>,
value: String,
plain_implicit: bool,
quoted_implicit: bool,
style: ScalarStyle,
) -> Self
pub const fn scalar( position: Position, anchor: Option<String>, tag: Option<String>, value: String, plain_implicit: bool, quoted_implicit: bool, style: ScalarStyle, ) -> Self
Create a scalar event
Sourcepub const fn sequence_start(
position: Position,
anchor: Option<String>,
tag: Option<String>,
flow_style: bool,
) -> Self
pub const fn sequence_start( position: Position, anchor: Option<String>, tag: Option<String>, flow_style: bool, ) -> Self
Create a sequence start event
Sourcepub const fn sequence_end(position: Position) -> Self
pub const fn sequence_end(position: Position) -> Self
Create a sequence end event
Sourcepub const fn mapping_start(
position: Position,
anchor: Option<String>,
tag: Option<String>,
flow_style: bool,
) -> Self
pub const fn mapping_start( position: Position, anchor: Option<String>, tag: Option<String>, flow_style: bool, ) -> Self
Create a mapping start event
Sourcepub const fn mapping_end(position: Position) -> Self
pub const fn mapping_end(position: Position) -> Self
Create a mapping end event
Sourcepub const fn is_collection_start(&self) -> bool
pub const fn is_collection_start(&self) -> bool
Check if this is a collection start event
Sourcepub const fn is_collection_end(&self) -> bool
pub const fn is_collection_end(&self) -> bool
Check if this is a collection end event
Sourcepub const fn is_document_boundary(&self) -> bool
pub const fn is_document_boundary(&self) -> bool
Check if this is a document boundary event
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.