MCPcopy Create free account
hub / github.com/csskit/csskit / try_parse

Method try_parse

crates/css_parse/src/traits/parse.rs:24–30  ·  view source on GitHub ↗
(p: &mut Parser<'a, I>)

Source from the content-addressed store, hash-verified

22 I: Iterator<Item = Cursor> + Clone;
23
24 fn try_parse<I>(p: &mut Parser<'a, I>) -> Result<Self>
25 where
26 I: Iterator<Item = Cursor> + Clone,
27 {
28 let checkpoint = p.checkpoint();
29 Self::parse(p).inspect_err(|_| p.rewind(checkpoint))
30 }
31}
32
33impl<'a, T> Parse<'a> for Option<T>

Callers

nothing calls this directly

Implementers 15

stylerule.rscrates/css_ast/src/stylerule.rs
stylesheet.rscrates/css_ast/src/stylesheet.rs
lib.rscrates/css_ast/src/lib.rs
constraints.rscrates/css_ast/src/constraints.rs
position.rscrates/css_ast/src/types/position.rs
bg_position.rscrates/css_ast/src/types/bg_position.r
generic_voice.rscrates/css_ast/src/types/generic_voice
grid_line.rscrates/css_ast/src/types/grid_line.rs
cursor_image.rscrates/css_ast/src/types/cursor_image.
single_transition.rscrates/css_ast/src/types/single_transi
display_listitem.rscrates/css_ast/src/types/display_listi
position_area.rscrates/css_ast/src/types/position_area

Calls 3

parseFunction · 0.70
checkpointMethod · 0.45
rewindMethod · 0.45

Tested by

no test coverage detected