pub enum Once<T> {
Missing {
name: &'static str,
},
Failure {
name_range: Range<usize>,
value_range: Range<usize>,
},
Success {
name_range: Range<usize>,
value_range: Range<usize>,
value: T,
},
}Variants§
Implementations§
Source§impl Once<bool>
impl Once<bool>
Sourcepub fn boolean_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)
pub fn boolean_attribute<'input, E>( &mut self, attribute: Attribute<'input, 'input>, errors: &mut Vec<E>, )
Parse a single boolean (yes/no) attribute
Source§impl Once<DottedPath>
impl Once<DottedPath>
Sourcepub fn dotted_path_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)
pub fn dotted_path_attribute<'input, E>( &mut self, attribute: Attribute<'input, 'input>, errors: &mut Vec<E>, )
Parse a single dotted path attribute
Source§impl<T: Clone> Once<T>
impl<T: Clone> Once<T>
Sourcepub fn enum_attribute<'input, E>(
&mut self,
values: &'static [(&'static str, T)],
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)
pub fn enum_attribute<'input, E>( &mut self, values: &'static [(&'static str, T)], attribute: Attribute<'input, 'input>, errors: &mut Vec<E>, )
Parse a single enum attribute
Source§impl<T> Once<T>
impl<T> Once<T>
Sourcepub fn is_duplicate_attribute<'input, E>(
&self,
attribute: &Attribute<'input, 'input>,
errors: &mut Vec<E>,
) -> boolwhere
E: From<ParseError>,
pub fn is_duplicate_attribute<'input, E>(
&self,
attribute: &Attribute<'input, 'input>,
errors: &mut Vec<E>,
) -> boolwhere
E: From<ParseError>,
Is this a duplicate attribute?
If yes, then raise an error.
Source§impl Once<usize>
impl Once<usize>
Sourcepub fn length_attribute<'input, E>(
&mut self,
range: RangeInclusive<usize>,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
pub fn length_attribute<'input, E>(
&mut self,
range: RangeInclusive<usize>,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
Parse a single length attribute,
a usize with bounded range.
Source§impl Once<LowerName>
impl Once<LowerName>
Sourcepub fn lower_name_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)
pub fn lower_name_attribute<'input, E>( &mut self, attribute: Attribute<'input, 'input>, errors: &mut Vec<E>, )
Parse a single lowercase name attribute
Source§impl Once<usize>
impl Once<usize>
Sourcepub fn number_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
pub fn number_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
Parse a single number attribute, a usize with no bound requirements
Source§impl Once<String>
impl Once<String>
Sourcepub fn string_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
pub fn string_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
Parse a string attribute
Source§impl Once<UpperName>
impl Once<UpperName>
Sourcepub fn upper_name_attribute<'input, E>(
&mut self,
attribute: Attribute<'input, 'input>,
errors: &mut Vec<E>,
)
pub fn upper_name_attribute<'input, E>( &mut self, attribute: Attribute<'input, 'input>, errors: &mut Vec<E>, )
Parse a single uppercase name attribute
Source§impl<T> Once<T>
impl<T> Once<T>
Sourcepub fn is_duplicate_element<'input, E>(
&self,
element: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> boolwhere
E: From<ParseError>,
pub fn is_duplicate_element<'input, E>(
&self,
element: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> boolwhere
E: From<ParseError>,
Check if duplicate element is being parsed.
If a duplicate is being parsed, return true and
raise an error.
Otherwise, return false.
Source§impl Once<usize>
impl Once<usize>
Sourcepub fn length_element<'input, E>(
&mut self,
attribute_name: &'static str,
range: RangeInclusive<usize>,
element: Node<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
pub fn length_element<'input, E>(
&mut self,
attribute_name: &'static str,
range: RangeInclusive<usize>,
element: Node<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
Parse a single length element,
a usize with bounded range.
Source§impl Once<String>
impl Once<String>
Sourcepub fn string_element<'input, E>(
&mut self,
element: Node<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
pub fn string_element<'input, E>(
&mut self,
element: Node<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
Parse a string element checking for duplicates
Sourcepub fn string_element_ignore_attributes<'input, E>(
&mut self,
element: Node<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
pub fn string_element_ignore_attributes<'input, E>(
&mut self,
element: Node<'input, 'input>,
errors: &mut Vec<E>,
)where
E: From<ParseError>,
Parse a string element checking for duplicates
Ignore attributes
Source§impl<T> Once<T>
impl<T> Once<T>
pub fn new(name: &'static str) -> Self
pub fn attribute_failure<'input>( &mut self, attribute: Attribute<'input, 'input>, )
pub fn attribute_success<'input>( &mut self, attribute: Attribute<'input, 'input>, value: T, )
pub fn default(self, default: T) -> T
pub fn default_with<W>(self, with: W) -> Twhere
W: FnOnce() -> T,
pub fn element_failure<'input>(&mut self, element: Node<'input, 'input>)
pub fn element_parsed_success<'input>( &mut self, element: Node<'input, 'input>, parsed: Parsed<T>, )
pub fn element_success<'input>( &mut self, element: Node<'input, 'input>, value: T, )
pub fn exist(&self) -> bool
pub fn exist_value(self) -> Option<Option<T>>
pub fn optional(self) -> Option<Option<T>>
pub fn optional_parsed(self) -> Option<Option<Parsed<T>>>
pub fn required_attribute<'input, E>(
self,
parent: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> Option<T>where
E: From<ParseError>,
Sourcepub fn required_element<'input, E>(
self,
parent: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> Option<T>where
E: From<ParseError>,
pub fn required_element<'input, E>(
self,
parent: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> Option<T>where
E: From<ParseError>,
Extract value of required element
If it does not exist, raise an error
pub fn required_parsed_attribute<'input, E>(
self,
parent: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> Option<Parsed<T>>where
E: From<ParseError>,
pub fn success_name_range(self) -> Option<Range<usize>>
pub fn take(&mut self) -> Self
Source§impl Once<bool>
impl Once<bool>
pub fn name_range_if_true(self) -> Option<Range<usize>>
pub fn required_yes_attribute<'input, E>(
self,
parent: &Node<'input, 'input>,
errors: &mut Vec<E>,
) -> boolwhere
E: From<ParseError>,
Auto Trait Implementations§
impl<T> Freeze for Once<T>where
T: Freeze,
impl<T> RefUnwindSafe for Once<T>where
T: RefUnwindSafe,
impl<T> Send for Once<T>where
T: Send,
impl<T> Sync for Once<T>where
T: Sync,
impl<T> Unpin for Once<T>where
T: Unpin,
impl<T> UnwindSafe for Once<T>where
T: UnwindSafe,
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
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more