use std::borrow::Cow;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Chomp {
Strip,
Clip,
Keep,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CollectionStyle {
Block,
Flow,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ScalarStyle {
Plain,
SingleQuoted,
DoubleQuoted,
Literal(Chomp),
Folded(Chomp),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Event<'input> {
StreamStart,
StreamEnd,
Comment {
text: &'input str,
},
Alias {
name: &'input str,
},
DocumentStart {
explicit: bool,
version: Option<(u8, u8)>,
tag_directives: Vec<(String, String)>,
},
DocumentEnd {
explicit: bool,
},
SequenceStart {
anchor: Option<&'input str>,
tag: Option<Cow<'input, str>>,
style: CollectionStyle,
},
SequenceEnd,
MappingStart {
anchor: Option<&'input str>,
tag: Option<Cow<'input, str>>,
style: CollectionStyle,
},
MappingEnd,
Scalar {
value: Cow<'input, str>,
style: ScalarStyle,
anchor: Option<&'input str>,
tag: Option<Cow<'input, str>>,
},
}