Coverage Report

Created: 2026-09-01 06:51

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/combine-4.6.8/src/parser/sequence.rs
Line
Count
Source
1
//! Combinators which take multiple parsers and applies them one after another.
2
3
use crate::{
4
    error::{
5
        ParseError,
6
        ParseResult::{self, *},
7
        StreamError, Tracked,
8
    },
9
    lib::marker::PhantomData,
10
    parser::{
11
        combinator::{ignore, Ignore, Map},
12
        ParseMode,
13
    },
14
    ErrorOffset, Parser, Stream, StreamOnce,
15
};
16
17
macro_rules! count {
18
    () => { 0 };
19
    ($f: ident) => { 1 };
20
    ($f: ident, $($rest: ident),+) => { 1 + count!($($rest),*) };
21
}
22
23
#[doc(hidden)]
24
pub struct SequenceState<T, U> {
25
    pub value: Option<T>,
26
    pub state: U,
27
}
28
29
impl<T, U: Default> Default for SequenceState<T, U> {
30
4.89M
    fn default() -> Self {
31
4.89M
        SequenceState {
32
4.89M
            value: None,
33
4.89M
            state: U::default(),
34
4.89M
        }
35
4.89M
    }
<combine::parser::sequence::SequenceState<redis::types::Value, ()> as core::default::Default>::default
Line
Count
Source
30
44.4k
    fn default() -> Self {
31
44.4k
        SequenceState {
32
44.4k
            value: None,
33
44.4k
            state: U::default(),
34
44.4k
        }
35
44.4k
    }
<combine::parser::sequence::SequenceState<alloc::string::String, ()> as core::default::Default>::default
Line
Count
Source
30
80.4k
    fn default() -> Self {
31
80.4k
        SequenceState {
32
80.4k
            value: None,
33
80.4k
            state: U::default(),
34
80.4k
        }
35
80.4k
    }
<combine::parser::sequence::SequenceState<u8, ()> as core::default::Default>::default
Line
Count
Source
30
156k
    fn default() -> Self {
31
156k
        SequenceState {
32
156k
            value: None,
33
156k
            state: U::default(),
34
156k
        }
35
156k
    }
<combine::parser::sequence::SequenceState<(), usize> as core::default::Default>::default
Line
Count
Source
30
2.16M
    fn default() -> Self {
31
2.16M
        SequenceState {
32
2.16M
            value: None,
33
2.16M
            state: U::default(),
34
2.16M
        }
35
2.16M
    }
<combine::parser::sequence::SequenceState<(), ()> as core::default::Default>::default
Line
Count
Source
30
2.44M
    fn default() -> Self {
31
2.44M
        SequenceState {
32
2.44M
            value: None,
33
2.44M
            state: U::default(),
34
2.44M
        }
35
2.44M
    }
Unexecuted instantiation: <combine::parser::sequence::SequenceState<_, _> as core::default::Default>::default
36
}
37
38
impl<T, U> SequenceState<T, U>
39
where
40
    U: Default,
41
{
42
17.3M
    unsafe fn unwrap_value(&mut self) -> T {
43
17.3M
        match self.value.take() {
44
17.3M
            Some(t) => t,
45
0
            None => core::hint::unreachable_unchecked(),
46
        }
47
17.3M
    }
<combine::parser::sequence::SequenceState<redis::types::Value, ()>>::unwrap_value
Line
Count
Source
42
47.3k
    unsafe fn unwrap_value(&mut self) -> T {
43
47.3k
        match self.value.take() {
44
47.3k
            Some(t) => t,
45
0
            None => core::hint::unreachable_unchecked(),
46
        }
47
47.3k
    }
<combine::parser::sequence::SequenceState<alloc::string::String, ()>>::unwrap_value
Line
Count
Source
42
108k
    unsafe fn unwrap_value(&mut self) -> T {
43
108k
        match self.value.take() {
44
108k
            Some(t) => t,
45
0
            None => core::hint::unreachable_unchecked(),
46
        }
47
108k
    }
<combine::parser::sequence::SequenceState<u8, ()>>::unwrap_value
Line
Count
Source
42
155k
    unsafe fn unwrap_value(&mut self) -> T {
43
155k
        match self.value.take() {
44
155k
            Some(t) => t,
45
0
            None => core::hint::unreachable_unchecked(),
46
        }
47
155k
    }
<combine::parser::sequence::SequenceState<(), usize>>::unwrap_value
Line
Count
Source
42
8.34M
    unsafe fn unwrap_value(&mut self) -> T {
43
8.34M
        match self.value.take() {
44
8.34M
            Some(t) => t,
45
0
            None => core::hint::unreachable_unchecked(),
46
        }
47
8.34M
    }
<combine::parser::sequence::SequenceState<(), ()>>::unwrap_value
Line
Count
Source
42
8.65M
    unsafe fn unwrap_value(&mut self) -> T {
43
8.65M
        match self.value.take() {
44
8.65M
            Some(t) => t,
45
0
            None => core::hint::unreachable_unchecked(),
46
        }
47
8.65M
    }
Unexecuted instantiation: <combine::parser::sequence::SequenceState<_, _>>::unwrap_value
48
}
49
50
macro_rules! last_ident {
51
    ($id: ident) => { $id };
52
    ($id: ident, $($rest: ident),+) => { last_ident!($($rest),+) };
53
}
54
55
438
fn add_sequence_error<Input>(
56
438
    i: &mut usize,
57
438
    first_empty_parser: usize,
58
438
    inner_offset: ErrorOffset,
59
438
    err: &mut Tracked<Input::Error>,
60
438
    parser: &mut impl Parser<Input>,
61
438
) -> bool
62
438
where
63
438
    Input: Stream,
64
{
65
438
    if *i + 1 == first_empty_parser {
66
219
        Parser::add_committed_expected_error(parser, err);
67
219
    }
68
438
    if *i >= first_empty_parser {
69
219
        if err.offset <= ErrorOffset(1) {
70
219
            // We reached the last parser we need to add errors to (and the
71
219
            // parser that actually returned the error), use the returned
72
219
            // offset for that parser.
73
219
            err.offset = inner_offset;
74
219
        }
75
219
        Parser::add_error(parser, err);
76
219
        if err.offset <= ErrorOffset(1) {
77
219
            return false;
78
0
        }
79
219
    }
80
219
    err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0));
81
82
219
    *i += 1;
83
219
    true
84
438
}
Unexecuted instantiation: combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>
combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>>
Line
Count
Source
55
83
fn add_sequence_error<Input>(
56
83
    i: &mut usize,
57
83
    first_empty_parser: usize,
58
83
    inner_offset: ErrorOffset,
59
83
    err: &mut Tracked<Input::Error>,
60
83
    parser: &mut impl Parser<Input>,
61
83
) -> bool
62
83
where
63
83
    Input: Stream,
64
{
65
83
    if *i + 1 == first_empty_parser {
66
83
        Parser::add_committed_expected_error(parser, err);
67
83
    }
68
83
    if *i >= first_empty_parser {
69
0
        if err.offset <= ErrorOffset(1) {
70
0
            // We reached the last parser we need to add errors to (and the
71
0
            // parser that actually returned the error), use the returned
72
0
            // offset for that parser.
73
0
            err.offset = inner_offset;
74
0
        }
75
0
        Parser::add_error(parser, err);
76
0
        if err.offset <= ErrorOffset(1) {
77
0
            return false;
78
0
        }
79
83
    }
80
83
    err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0));
81
82
83
    *i += 1;
83
83
    true
84
83
}
combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>>
Line
Count
Source
55
75
fn add_sequence_error<Input>(
56
75
    i: &mut usize,
57
75
    first_empty_parser: usize,
58
75
    inner_offset: ErrorOffset,
59
75
    err: &mut Tracked<Input::Error>,
60
75
    parser: &mut impl Parser<Input>,
61
75
) -> bool
62
75
where
63
75
    Input: Stream,
64
{
65
75
    if *i + 1 == first_empty_parser {
66
75
        Parser::add_committed_expected_error(parser, err);
67
75
    }
68
75
    if *i >= first_empty_parser {
69
0
        if err.offset <= ErrorOffset(1) {
70
0
            // We reached the last parser we need to add errors to (and the
71
0
            // parser that actually returned the error), use the returned
72
0
            // offset for that parser.
73
0
            err.offset = inner_offset;
74
0
        }
75
0
        Parser::add_error(parser, err);
76
0
        if err.offset <= ErrorOffset(1) {
77
0
            return false;
78
0
        }
79
75
    }
80
75
    err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0));
81
82
75
    *i += 1;
83
75
    true
84
75
}
Unexecuted instantiation: combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Ignore<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>>
combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>>
Line
Count
Source
55
158
fn add_sequence_error<Input>(
56
158
    i: &mut usize,
57
158
    first_empty_parser: usize,
58
158
    inner_offset: ErrorOffset,
59
158
    err: &mut Tracked<Input::Error>,
60
158
    parser: &mut impl Parser<Input>,
61
158
) -> bool
62
158
where
63
158
    Input: Stream,
64
{
65
158
    if *i + 1 == first_empty_parser {
66
0
        Parser::add_committed_expected_error(parser, err);
67
158
    }
68
158
    if *i >= first_empty_parser {
69
158
        if err.offset <= ErrorOffset(1) {
70
158
            // We reached the last parser we need to add errors to (and the
71
158
            // parser that actually returned the error), use the returned
72
158
            // offset for that parser.
73
158
            err.offset = inner_offset;
74
158
        }
75
158
        Parser::add_error(parser, err);
76
158
        if err.offset <= ErrorOffset(1) {
77
158
            return false;
78
0
        }
79
0
    }
80
0
    err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0));
81
82
0
    *i += 1;
83
0
    true
84
158
}
combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Ignore<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>>>
Line
Count
Source
55
61
fn add_sequence_error<Input>(
56
61
    i: &mut usize,
57
61
    first_empty_parser: usize,
58
61
    inner_offset: ErrorOffset,
59
61
    err: &mut Tracked<Input::Error>,
60
61
    parser: &mut impl Parser<Input>,
61
61
) -> bool
62
61
where
63
61
    Input: Stream,
64
{
65
61
    if *i + 1 == first_empty_parser {
66
61
        Parser::add_committed_expected_error(parser, err);
67
61
    }
68
61
    if *i >= first_empty_parser {
69
0
        if err.offset <= ErrorOffset(1) {
70
0
            // We reached the last parser we need to add errors to (and the
71
0
            // parser that actually returned the error), use the returned
72
0
            // offset for that parser.
73
0
            err.offset = inner_offset;
74
0
        }
75
0
        Parser::add_error(parser, err);
76
0
        if err.offset <= ErrorOffset(1) {
77
0
            return false;
78
0
        }
79
61
    }
80
61
    err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0));
81
82
61
    *i += 1;
83
61
    true
84
61
}
combine::parser::sequence::add_sequence_error::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>
Line
Count
Source
55
61
fn add_sequence_error<Input>(
56
61
    i: &mut usize,
57
61
    first_empty_parser: usize,
58
61
    inner_offset: ErrorOffset,
59
61
    err: &mut Tracked<Input::Error>,
60
61
    parser: &mut impl Parser<Input>,
61
61
) -> bool
62
61
where
63
61
    Input: Stream,
64
{
65
61
    if *i + 1 == first_empty_parser {
66
0
        Parser::add_committed_expected_error(parser, err);
67
61
    }
68
61
    if *i >= first_empty_parser {
69
61
        if err.offset <= ErrorOffset(1) {
70
61
            // We reached the last parser we need to add errors to (and the
71
61
            // parser that actually returned the error), use the returned
72
61
            // offset for that parser.
73
61
            err.offset = inner_offset;
74
61
        }
75
61
        Parser::add_error(parser, err);
76
61
        if err.offset <= ErrorOffset(1) {
77
61
            return false;
78
0
        }
79
0
    }
80
0
    err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0));
81
82
0
    *i += 1;
83
0
    true
84
61
}
Unexecuted instantiation: combine::parser::sequence::add_sequence_error::<_, _>
85
86
macro_rules! tuple_parser {
87
    ($partial_state: ident; $h: ident $(, $id: ident)*) => {
88
        #[allow(non_snake_case)]
89
        #[derive(Default)]
90
        pub struct $partial_state < $h $(, $id )* > {
91
            pub $h: $h,
92
            $(
93
                pub $id: $id,
94
            )*
95
            #[allow(dead_code)]
96
            offset: u8,
97
            _marker: PhantomData <( $h, $( $id),* )>,
98
        }
99
100
101
        #[allow(non_snake_case)]
102
        impl<$h $(, $id)*> $partial_state<$h $(, $id)*> {
103
            #[allow(dead_code)]
104
0
            fn add_errors<Input>(
105
0
                input: &mut Input,
106
0
                mut err: Tracked<Input::Error>,
107
0
                first_empty_parser: usize,
108
0
                offset: u8,
109
0
                $h: &mut $h $(, $id : &mut $id )*
110
0
            ) -> ParseResult<($h::Output, $($id::Output),*), <Input as StreamOnce>::Error>
111
0
                where Input: Stream,
112
0
                      $h: Parser<Input>,
113
420
                      $($id: Parser<Input>),*
114
            {
115
420
                let inner_offset = err.offset;
116
420
                err.offset = ErrorOffset(offset);
117
420
                if first_empty_parser != 0 {
118
219
                    if let Ok(t) = input.uncons() {
119
198
                        err.error.add(StreamError::unexpected_token(t));
120
198
                    }
121
122
                    #[allow(unused_assignments)]
123
219
                    let mut i = 0;
124
                    loop {
125
219
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $h) {
126
0
                            break;
127
219
                        }
128
                        $(
129
219
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $id) {
130
219
                            break;
131
0
                        }
132
                        )*
133
0
                        break;
134
                    }
135
219
                    CommitErr(err.error)
136
                } else {
137
201
                    PeekErr(err)
138
                }
139
420
            }
<combine::parser::sequence::PartialState2<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>>>::add_errors::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>
Line
Count
Source
104
178
            fn add_errors<Input>(
105
178
                input: &mut Input,
106
178
                mut err: Tracked<Input::Error>,
107
178
                first_empty_parser: usize,
108
178
                offset: u8,
109
178
                $h: &mut $h $(, $id : &mut $id )*
110
178
            ) -> ParseResult<($h::Output, $($id::Output),*), <Input as StreamOnce>::Error>
111
178
                where Input: Stream,
112
178
                      $h: Parser<Input>,
113
178
                      $($id: Parser<Input>),*
114
            {
115
178
                let inner_offset = err.offset;
116
178
                err.offset = ErrorOffset(offset);
117
178
                if first_empty_parser != 0 {
118
83
                    if let Ok(t) = input.uncons() {
119
83
                        err.error.add(StreamError::unexpected_token(t));
120
83
                    }
121
122
                    #[allow(unused_assignments)]
123
83
                    let mut i = 0;
124
                    loop {
125
83
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $h) {
126
0
                            break;
127
83
                        }
128
                        $(
129
83
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $id) {
130
83
                            break;
131
0
                        }
132
                        )*
133
0
                        break;
134
                    }
135
83
                    CommitErr(err.error)
136
                } else {
137
95
                    PeekErr(err)
138
                }
139
178
            }
<combine::parser::sequence::PartialState2<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>>>::add_errors::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>
Line
Count
Source
104
181
            fn add_errors<Input>(
105
181
                input: &mut Input,
106
181
                mut err: Tracked<Input::Error>,
107
181
                first_empty_parser: usize,
108
181
                offset: u8,
109
181
                $h: &mut $h $(, $id : &mut $id )*
110
181
            ) -> ParseResult<($h::Output, $($id::Output),*), <Input as StreamOnce>::Error>
111
181
                where Input: Stream,
112
181
                      $h: Parser<Input>,
113
181
                      $($id: Parser<Input>),*
114
            {
115
181
                let inner_offset = err.offset;
116
181
                err.offset = ErrorOffset(offset);
117
181
                if first_empty_parser != 0 {
118
75
                    if let Ok(t) = input.uncons() {
119
75
                        err.error.add(StreamError::unexpected_token(t));
120
75
                    }
121
122
                    #[allow(unused_assignments)]
123
75
                    let mut i = 0;
124
                    loop {
125
75
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $h) {
126
0
                            break;
127
75
                        }
128
                        $(
129
75
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $id) {
130
75
                            break;
131
0
                        }
132
                        )*
133
0
                        break;
134
                    }
135
75
                    CommitErr(err.error)
136
                } else {
137
106
                    PeekErr(err)
138
                }
139
181
            }
Unexecuted instantiation: <combine::parser::sequence::PartialState2<combine::parser::combinator::Ignore<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>::add_errors::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>
<combine::parser::sequence::PartialState2<combine::parser::combinator::Ignore<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>::add_errors::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>
Line
Count
Source
104
61
            fn add_errors<Input>(
105
61
                input: &mut Input,
106
61
                mut err: Tracked<Input::Error>,
107
61
                first_empty_parser: usize,
108
61
                offset: u8,
109
61
                $h: &mut $h $(, $id : &mut $id )*
110
61
            ) -> ParseResult<($h::Output, $($id::Output),*), <Input as StreamOnce>::Error>
111
61
                where Input: Stream,
112
61
                      $h: Parser<Input>,
113
61
                      $($id: Parser<Input>),*
114
            {
115
61
                let inner_offset = err.offset;
116
61
                err.offset = ErrorOffset(offset);
117
61
                if first_empty_parser != 0 {
118
61
                    if let Ok(t) = input.uncons() {
119
40
                        err.error.add(StreamError::unexpected_token(t));
120
40
                    }
121
122
                    #[allow(unused_assignments)]
123
61
                    let mut i = 0;
124
                    loop {
125
61
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $h) {
126
0
                            break;
127
61
                        }
128
                        $(
129
61
                        if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $id) {
130
61
                            break;
131
0
                        }
132
                        )*
133
0
                        break;
134
                    }
135
61
                    CommitErr(err.error)
136
                } else {
137
0
                    PeekErr(err)
138
                }
139
61
            }
Unexecuted instantiation: <combine::parser::sequence::PartialState20<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState1<_>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState2<_, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState12<_, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState13<_, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState14<_, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState15<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState16<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState17<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState18<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState19<_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState3<_, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState4<_, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState5<_, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState6<_, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState7<_, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState8<_, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState9<_, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState10<_, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
Unexecuted instantiation: <combine::parser::sequence::PartialState11<_, _, _, _, _, _, _, _, _, _, _>>::add_errors::<_>
140
        }
141
142
        #[allow(non_snake_case)]
143
        impl <Input: Stream, $h:, $($id:),*> Parser<Input> for ($h, $($id),*)
144
            where Input: Stream,
145
                  $h: Parser<Input>,
146
                  $($id: Parser<Input>),*
147
        {
148
149
            type Output = ($h::Output, $($id::Output),*);
150
            type PartialState = $partial_state<
151
                SequenceState<$h::Output, $h::PartialState>
152
                $(, SequenceState<$id::Output, $id::PartialState>)*
153
            >;
154
155
            parse_mode!(Input);
156
            #[inline]
157
8.69M
            fn parse_mode_impl<MODE>(
158
8.69M
                &mut self,
159
8.69M
                mut mode: MODE,
160
8.69M
                input: &mut Input,
161
8.69M
                state: &mut Self::PartialState,
162
8.69M
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
8.69M
            where
164
8.69M
                MODE: ParseMode,
165
            {
166
8.69M
                let (ref mut $h, $(ref mut $id),*) = *self;
167
8.69M
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
8.69M
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
8.69M
                if mode.is_first() || state.$h.value.is_none() {
181
8.69M
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
2.40M
                        CommitOk(x) => {
183
2.40M
                            first_empty_parser = current_parser + 1;
184
2.40M
                            x
185
                        }
186
1.33k
                        PeekErr(err) => return PeekErr(err),
187
37.2k
                        CommitErr(err) => return CommitErr(err),
188
6.25M
                        PeekOk(x) => {
189
6.25M
                            x
190
                        }
191
                    };
192
8.65M
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
8.65M
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
8.65M
                    mode.set_first();
199
555
                }
200
201
                $(
202
8.65M
                    if mode.is_first() || state.$id.value.is_none() {
203
8.65M
                        current_parser += 1;
204
8.65M
                        let before = input.checkpoint();
205
8.65M
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
8.65M
                            CommitOk(x) => {
207
8.65M
                                first_empty_parser = current_parser + 1;
208
8.65M
                                x
209
                            }
210
420
                            PeekErr(err) => {
211
420
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
420
                                }
218
420
                                return add_errors!(err, state.offset)
219
                            }
220
834
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
8.65M
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
8.65M
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
8.65M
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
8.65M
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
8.65M
                if first_empty_parser != 0 {
238
8.65M
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
8.69M
            }
<(combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
157
1.62k
            fn parse_mode_impl<MODE>(
158
1.62k
                &mut self,
159
1.62k
                mut mode: MODE,
160
1.62k
                input: &mut Input,
161
1.62k
                state: &mut Self::PartialState,
162
1.62k
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
1.62k
            where
164
1.62k
                MODE: ParseMode,
165
            {
166
1.62k
                let (ref mut $h, $(ref mut $id),*) = *self;
167
1.62k
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
1.62k
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
1.62k
                if mode.is_first() || state.$h.value.is_none() {
181
1.35k
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
238
                        CommitOk(x) => {
183
238
                            first_empty_parser = current_parser + 1;
184
238
                            x
185
                        }
186
191
                        PeekErr(err) => return PeekErr(err),
187
921
                        CommitErr(err) => return CommitErr(err),
188
0
                        PeekOk(x) => {
189
0
                            x
190
                        }
191
                    };
192
238
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
238
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
238
                    mode.set_first();
199
274
                }
200
201
                $(
202
512
                    if mode.is_first() || state.$id.value.is_none() {
203
512
                        current_parser += 1;
204
512
                        let before = input.checkpoint();
205
512
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
310
                            CommitOk(x) => {
207
310
                                first_empty_parser = current_parser + 1;
208
310
                                x
209
                            }
210
96
                            PeekErr(err) => {
211
96
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
96
                                }
218
96
                                return add_errors!(err, state.offset)
219
                            }
220
106
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
310
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
310
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
310
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
310
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
310
                if first_empty_parser != 0 {
238
310
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
1.62k
            }
<(combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
157
47.7k
            fn parse_mode_impl<MODE>(
158
47.7k
                &mut self,
159
47.7k
                mut mode: MODE,
160
47.7k
                input: &mut Input,
161
47.7k
                state: &mut Self::PartialState,
162
47.7k
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
47.7k
            where
164
47.7k
                MODE: ParseMode,
165
            {
166
47.7k
                let (ref mut $h, $(ref mut $id),*) = *self;
167
47.7k
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
47.7k
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
47.7k
                if mode.is_first() || state.$h.value.is_none() {
181
47.7k
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
45.4k
                        CommitOk(x) => {
183
45.4k
                            first_empty_parser = current_parser + 1;
184
45.4k
                            x
185
                        }
186
0
                        PeekErr(err) => return PeekErr(err),
187
429
                        CommitErr(err) => return CommitErr(err),
188
1.86k
                        PeekOk(x) => {
189
1.86k
                            x
190
                        }
191
                    };
192
47.3k
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
47.3k
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
47.3k
                    mode.set_first();
199
0
                }
200
201
                $(
202
47.3k
                    if mode.is_first() || state.$id.value.is_none() {
203
47.3k
                        current_parser += 1;
204
47.3k
                        let before = input.checkpoint();
205
47.3k
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
47.0k
                            CommitOk(x) => {
207
47.0k
                                first_empty_parser = current_parser + 1;
208
47.0k
                                x
209
                            }
210
82
                            PeekErr(err) => {
211
82
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
82
                                }
218
82
                                return add_errors!(err, state.offset)
219
                            }
220
205
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
47.0k
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
47.0k
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
47.0k
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
47.0k
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
47.0k
                if first_empty_parser != 0 {
238
47.0k
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
47.7k
            }
<(combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
157
3.74k
            fn parse_mode_impl<MODE>(
158
3.74k
                &mut self,
159
3.74k
                mut mode: MODE,
160
3.74k
                input: &mut Input,
161
3.74k
                state: &mut Self::PartialState,
162
3.74k
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
3.74k
            where
164
3.74k
                MODE: ParseMode,
165
            {
166
3.74k
                let (ref mut $h, $(ref mut $id),*) = *self;
167
3.74k
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
3.74k
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
3.74k
                if mode.is_first() || state.$h.value.is_none() {
181
3.46k
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
589
                        CommitOk(x) => {
183
589
                            first_empty_parser = current_parser + 1;
184
589
                            x
185
                        }
186
182
                        PeekErr(err) => return PeekErr(err),
187
2.69k
                        CommitErr(err) => return CommitErr(err),
188
0
                        PeekOk(x) => {
189
0
                            x
190
                        }
191
                    };
192
589
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
589
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
589
                    mode.set_first();
199
281
                }
200
201
                $(
202
870
                    if mode.is_first() || state.$id.value.is_none() {
203
870
                        current_parser += 1;
204
870
                        let before = input.checkpoint();
205
870
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
730
                            CommitOk(x) => {
207
730
                                first_empty_parser = current_parser + 1;
208
730
                                x
209
                            }
210
88
                            PeekErr(err) => {
211
88
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
88
                                }
218
88
                                return add_errors!(err, state.offset)
219
                            }
220
52
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
730
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
730
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
730
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
730
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
730
                if first_empty_parser != 0 {
238
730
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
3.74k
            }
<(combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
157
108k
            fn parse_mode_impl<MODE>(
158
108k
                &mut self,
159
108k
                mut mode: MODE,
160
108k
                input: &mut Input,
161
108k
                state: &mut Self::PartialState,
162
108k
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
108k
            where
164
108k
                MODE: ParseMode,
165
            {
166
108k
                let (ref mut $h, $(ref mut $id),*) = *self;
167
108k
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
108k
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
108k
                if mode.is_first() || state.$h.value.is_none() {
181
108k
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
95.9k
                        CommitOk(x) => {
183
95.9k
                            first_empty_parser = current_parser + 1;
184
95.9k
                            x
185
                        }
186
0
                        PeekErr(err) => return PeekErr(err),
187
771
                        CommitErr(err) => return CommitErr(err),
188
11.8k
                        PeekOk(x) => {
189
11.8k
                            x
190
                        }
191
                    };
192
107k
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
107k
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
107k
                    mode.set_first();
199
0
                }
200
201
                $(
202
107k
                    if mode.is_first() || state.$id.value.is_none() {
203
107k
                        current_parser += 1;
204
107k
                        let before = input.checkpoint();
205
107k
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
107k
                            CommitOk(x) => {
207
107k
                                first_empty_parser = current_parser + 1;
208
107k
                                x
209
                            }
210
93
                            PeekErr(err) => {
211
93
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
93
                                }
218
93
                                return add_errors!(err, state.offset)
219
                            }
220
253
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
107k
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
107k
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
107k
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
107k
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
107k
                if first_empty_parser != 0 {
238
107k
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
108k
            }
<(combine::parser::combinator::Ignore<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
157
31.1k
            fn parse_mode_impl<MODE>(
158
31.1k
                &mut self,
159
31.1k
                mut mode: MODE,
160
31.1k
                input: &mut Input,
161
31.1k
                state: &mut Self::PartialState,
162
31.1k
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
31.1k
            where
164
31.1k
                MODE: ParseMode,
165
            {
166
31.1k
                let (ref mut $h, $(ref mut $id),*) = *self;
167
31.1k
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
31.1k
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
31.1k
                if mode.is_first() || state.$h.value.is_none() {
181
31.1k
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
10.2k
                        CommitOk(x) => {
183
10.2k
                            first_empty_parser = current_parser + 1;
184
10.2k
                            x
185
                        }
186
604
                        PeekErr(err) => return PeekErr(err),
187
18.7k
                        CommitErr(err) => return CommitErr(err),
188
1.53k
                        PeekOk(x) => {
189
1.53k
                            x
190
                        }
191
                    };
192
11.8k
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
11.8k
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
11.8k
                    mode.set_first();
199
0
                }
200
201
                $(
202
11.8k
                    if mode.is_first() || state.$id.value.is_none() {
203
11.8k
                        current_parser += 1;
204
11.8k
                        let before = input.checkpoint();
205
11.8k
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
11.8k
                            CommitOk(x) => {
207
11.8k
                                first_empty_parser = current_parser + 1;
208
11.8k
                                x
209
                            }
210
0
                            PeekErr(err) => {
211
0
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
0
                                }
218
0
                                return add_errors!(err, state.offset)
219
                            }
220
0
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
11.8k
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
11.8k
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
11.8k
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
11.8k
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
11.8k
                if first_empty_parser != 0 {
238
11.8k
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
31.1k
            }
<(combine::parser::combinator::Ignore<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
157
8.34M
            fn parse_mode_impl<MODE>(
158
8.34M
                &mut self,
159
8.34M
                mut mode: MODE,
160
8.34M
                input: &mut Input,
161
8.34M
                state: &mut Self::PartialState,
162
8.34M
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
8.34M
            where
164
8.34M
                MODE: ParseMode,
165
            {
166
8.34M
                let (ref mut $h, $(ref mut $id),*) = *self;
167
8.34M
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
8.34M
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
8.34M
                if mode.is_first() || state.$h.value.is_none() {
181
8.34M
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
2.09M
                        CommitOk(x) => {
183
2.09M
                            first_empty_parser = current_parser + 1;
184
2.09M
                            x
185
                        }
186
0
                        PeekErr(err) => return PeekErr(err),
187
13.3k
                        CommitErr(err) => return CommitErr(err),
188
6.23M
                        PeekOk(x) => {
189
6.23M
                            x
190
                        }
191
                    };
192
8.33M
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
8.33M
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
8.33M
                    mode.set_first();
199
0
                }
200
201
                $(
202
8.33M
                    if mode.is_first() || state.$id.value.is_none() {
203
8.33M
                        current_parser += 1;
204
8.33M
                        let before = input.checkpoint();
205
8.33M
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
8.33M
                            CommitOk(x) => {
207
8.33M
                                first_empty_parser = current_parser + 1;
208
8.33M
                                x
209
                            }
210
0
                            PeekErr(err) => {
211
0
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
0
                                }
218
0
                                return add_errors!(err, state.offset)
219
                            }
220
0
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
8.33M
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
8.33M
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
8.33M
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
8.33M
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
8.33M
                if first_empty_parser != 0 {
238
8.33M
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
8.34M
            }
<(combine::parser::combinator::Ignore<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
157
156k
            fn parse_mode_impl<MODE>(
158
156k
                &mut self,
159
156k
                mut mode: MODE,
160
156k
                input: &mut Input,
161
156k
                state: &mut Self::PartialState,
162
156k
            ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
163
156k
            where
164
156k
                MODE: ParseMode,
165
            {
166
156k
                let (ref mut $h, $(ref mut $id),*) = *self;
167
156k
                let mut first_empty_parser = 0;
168
                #[allow(unused_mut)]
169
156k
                let mut current_parser = 0;
170
171
                #[allow(unused_macros)]
172
                macro_rules! add_errors {
173
                    ($err: ident, $offset: expr) => {
174
                        $partial_state::add_errors(
175
                            input, $err, first_empty_parser, $offset, $h, $($id),*
176
                        )
177
                    }
178
                }
179
180
156k
                if mode.is_first() || state.$h.value.is_none() {
181
156k
                    let temp = match $h.parse_mode(mode, input, &mut state.$h.state) {
182
155k
                        CommitOk(x) => {
183
155k
                            first_empty_parser = current_parser + 1;
184
155k
                            x
185
                        }
186
359
                        PeekErr(err) => return PeekErr(err),
187
337
                        CommitErr(err) => return CommitErr(err),
188
0
                        PeekOk(x) => {
189
0
                            x
190
                        }
191
                    };
192
155k
                    state.offset = $h.parser_count().0.saturating_add(1);
193
                    // SAFETY: must be set to avoid UB below when unwrapping
194
155k
                    state.$h.value = Some(temp);
195
196
                    // Once we have successfully parsed the partial input we may resume parsing in
197
                    // "first mode"
198
155k
                    mode.set_first();
199
0
                }
200
201
                $(
202
155k
                    if mode.is_first() || state.$id.value.is_none() {
203
155k
                        current_parser += 1;
204
155k
                        let before = input.checkpoint();
205
155k
                        let temp = match $id.parse_mode(mode, input, &mut state.$id.state) {
206
155k
                            CommitOk(x) => {
207
155k
                                first_empty_parser = current_parser + 1;
208
155k
                                x
209
                            }
210
61
                            PeekErr(err) => {
211
61
                                if let Err(err) = input.reset(before) {
212
0
                                    return if first_empty_parser != 0 {
213
0
                                        CommitErr(err.into())
214
                                    } else {
215
0
                                        PeekErr(err.into())
216
                                    };
217
61
                                }
218
61
                                return add_errors!(err, state.offset)
219
                            }
220
218
                            CommitErr(err) => return CommitErr(err),
221
0
                            PeekOk(x) => {
222
0
                                x
223
                            }
224
                        };
225
155k
                        state.offset = state.offset.saturating_add($id.parser_count().0);
226
                        // SAFETY: must be set to avoid UB below when unwrapping
227
155k
                        state.$id.value = Some(temp);
228
229
                        // Once we have successfully parsed the partial input we may resume parsing in
230
                        // "first mode"
231
155k
                        mode.set_first();
232
0
                    }
233
                )*
234
235
                // SAFETY: requires both $h and $id to be set, see previous SAFETY comments
236
155k
                let value = unsafe { (state.$h.unwrap_value(), $(state.$id.unwrap_value()),*) };
237
155k
                if first_empty_parser != 0 {
238
155k
                    CommitOk(value)
239
                } else {
240
0
                    PeekOk(value)
241
                }
242
156k
            }
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_,) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parse_mode_impl::<_>
243
244
            #[inline]
245
155k
            fn parser_count(&self) -> ErrorOffset {
246
155k
                let (ref $h, $(ref $id),*) = *self;
247
155k
                ErrorOffset($h.parser_count().0 $( + $id.parser_count().0)*)
248
155k
            }
<(combine::parser::combinator::Ignore<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parser_count
Line
Count
Source
245
155k
            fn parser_count(&self) -> ErrorOffset {
246
155k
                let (ref $h, $(ref $id),*) = *self;
247
155k
                ErrorOffset($h.parser_count().0 $( + $id.parser_count().0)*)
248
155k
            }
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_,) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::parser_count
249
250
            #[inline]
251
1.53k
            fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
252
1.53k
                let (ref mut $h, $(ref mut $id),*) = *self;
253
1.53k
                let prev = errors.offset;
254
1.53k
                $h.add_error(errors);
255
1.53k
                if errors.offset <= ErrorOffset(1) {
256
1.33k
                    errors.offset = ErrorOffset(
257
1.33k
                        errors.offset.0.saturating_sub(1)
258
1.33k
                    );
259
1.33k
                    return;
260
201
                }
261
201
                if errors.offset == prev {
262
201
                    errors.offset = ErrorOffset(errors.offset.0.saturating_sub($h.parser_count().0));
263
201
                }
264
265
                #[allow(dead_code)]
266
                const LAST: usize = count!($($id),*);
267
                #[allow(unused_mut, unused_variables)]
268
201
                let mut i = 0;
269
                $(
270
201
                    i += 1;
271
201
                    let prev = errors.offset;
272
201
                    $id.add_error(errors);
273
201
                    if errors.offset <= ErrorOffset(1) {
274
201
                        errors.offset = ErrorOffset(
275
201
                            errors.offset.0.saturating_sub(1)
276
201
                        );
277
201
                        return;
278
0
                    }
279
0
                    if i != LAST && errors.offset == prev {
280
0
                        errors.offset = ErrorOffset(
281
0
                            errors.offset.0.saturating_sub($id.parser_count().0)
282
0
                        );
283
0
                    }
284
                )*
285
1.53k
            }
<(combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
251
286
            fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
252
286
                let (ref mut $h, $(ref mut $id),*) = *self;
253
286
                let prev = errors.offset;
254
286
                $h.add_error(errors);
255
286
                if errors.offset <= ErrorOffset(1) {
256
191
                    errors.offset = ErrorOffset(
257
191
                        errors.offset.0.saturating_sub(1)
258
191
                    );
259
191
                    return;
260
95
                }
261
95
                if errors.offset == prev {
262
95
                    errors.offset = ErrorOffset(errors.offset.0.saturating_sub($h.parser_count().0));
263
95
                }
264
265
                #[allow(dead_code)]
266
                const LAST: usize = count!($($id),*);
267
                #[allow(unused_mut, unused_variables)]
268
95
                let mut i = 0;
269
                $(
270
95
                    i += 1;
271
95
                    let prev = errors.offset;
272
95
                    $id.add_error(errors);
273
95
                    if errors.offset <= ErrorOffset(1) {
274
95
                        errors.offset = ErrorOffset(
275
95
                            errors.offset.0.saturating_sub(1)
276
95
                        );
277
95
                        return;
278
0
                    }
279
0
                    if i != LAST && errors.offset == prev {
280
0
                        errors.offset = ErrorOffset(
281
0
                            errors.offset.0.saturating_sub($id.parser_count().0)
282
0
                        );
283
0
                    }
284
                )*
285
286
            }
<(combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::combinator::Ignore<combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
251
288
            fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
252
288
                let (ref mut $h, $(ref mut $id),*) = *self;
253
288
                let prev = errors.offset;
254
288
                $h.add_error(errors);
255
288
                if errors.offset <= ErrorOffset(1) {
256
182
                    errors.offset = ErrorOffset(
257
182
                        errors.offset.0.saturating_sub(1)
258
182
                    );
259
182
                    return;
260
106
                }
261
106
                if errors.offset == prev {
262
106
                    errors.offset = ErrorOffset(errors.offset.0.saturating_sub($h.parser_count().0));
263
106
                }
264
265
                #[allow(dead_code)]
266
                const LAST: usize = count!($($id),*);
267
                #[allow(unused_mut, unused_variables)]
268
106
                let mut i = 0;
269
                $(
270
106
                    i += 1;
271
106
                    let prev = errors.offset;
272
106
                    $id.add_error(errors);
273
106
                    if errors.offset <= ErrorOffset(1) {
274
106
                        errors.offset = ErrorOffset(
275
106
                            errors.offset.0.saturating_sub(1)
276
106
                        );
277
106
                        return;
278
0
                    }
279
0
                    if i != LAST && errors.offset == prev {
280
0
                        errors.offset = ErrorOffset(
281
0
                            errors.offset.0.saturating_sub($id.parser_count().0)
282
0
                        );
283
0
                    }
284
                )*
285
288
            }
<(combine::parser::combinator::Ignore<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
251
604
            fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
252
604
                let (ref mut $h, $(ref mut $id),*) = *self;
253
604
                let prev = errors.offset;
254
604
                $h.add_error(errors);
255
604
                if errors.offset <= ErrorOffset(1) {
256
604
                    errors.offset = ErrorOffset(
257
604
                        errors.offset.0.saturating_sub(1)
258
604
                    );
259
604
                    return;
260
0
                }
261
0
                if errors.offset == prev {
262
0
                    errors.offset = ErrorOffset(errors.offset.0.saturating_sub($h.parser_count().0));
263
0
                }
264
265
                #[allow(dead_code)]
266
                const LAST: usize = count!($($id),*);
267
                #[allow(unused_mut, unused_variables)]
268
0
                let mut i = 0;
269
                $(
270
0
                    i += 1;
271
0
                    let prev = errors.offset;
272
0
                    $id.add_error(errors);
273
0
                    if errors.offset <= ErrorOffset(1) {
274
0
                        errors.offset = ErrorOffset(
275
0
                            errors.offset.0.saturating_sub(1)
276
0
                        );
277
0
                        return;
278
0
                    }
279
0
                    if i != LAST && errors.offset == prev {
280
0
                        errors.offset = ErrorOffset(
281
0
                            errors.offset.0.saturating_sub($id.parser_count().0)
282
0
                        );
283
0
                    }
284
                )*
285
604
            }
<(combine::parser::combinator::Ignore<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
251
359
            fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
252
359
                let (ref mut $h, $(ref mut $id),*) = *self;
253
359
                let prev = errors.offset;
254
359
                $h.add_error(errors);
255
359
                if errors.offset <= ErrorOffset(1) {
256
359
                    errors.offset = ErrorOffset(
257
359
                        errors.offset.0.saturating_sub(1)
258
359
                    );
259
359
                    return;
260
0
                }
261
0
                if errors.offset == prev {
262
0
                    errors.offset = ErrorOffset(errors.offset.0.saturating_sub($h.parser_count().0));
263
0
                }
264
265
                #[allow(dead_code)]
266
                const LAST: usize = count!($($id),*);
267
                #[allow(unused_mut, unused_variables)]
268
0
                let mut i = 0;
269
                $(
270
0
                    i += 1;
271
0
                    let prev = errors.offset;
272
0
                    $id.add_error(errors);
273
0
                    if errors.offset <= ErrorOffset(1) {
274
0
                        errors.offset = ErrorOffset(
275
0
                            errors.offset.0.saturating_sub(1)
276
0
                        );
277
0
                        return;
278
0
                    }
279
0
                    if i != LAST && errors.offset == prev {
280
0
                        errors.offset = ErrorOffset(
281
0
                            errors.offset.0.saturating_sub($id.parser_count().0)
282
0
                        );
283
0
                    }
284
                )*
285
359
            }
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_,) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_error
286
287
0
            fn add_committed_expected_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
288
                #[allow(unused_variables)]
289
0
                let (ref mut $h, $(ref mut $id),*) = *self;
290
0
                last_ident!($h $(, $id)*).add_committed_expected_error(errors)
291
0
            }
Unexecuted instantiation: <(combine::parser::combinator::Ignore<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>) as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_,) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
Unexecuted instantiation: <(_, _, _, _, _, _, _, _, _, _) as combine::parser::Parser<_>>::add_committed_expected_error
292
        }
293
    }
294
}
295
296
tuple_parser!(PartialState1; A);
297
tuple_parser!(PartialState2; A, B);
298
tuple_parser!(PartialState3; A, B, C);
299
tuple_parser!(PartialState4; A, B, C, D);
300
tuple_parser!(PartialState5; A, B, C, D, E);
301
tuple_parser!(PartialState6; A, B, C, D, E, F);
302
tuple_parser!(PartialState7; A, B, C, D, E, F, G);
303
tuple_parser!(PartialState8; A, B, C, D, E, F, G, H);
304
tuple_parser!(PartialState9; A, B, C, D, E, F, G, H, I);
305
tuple_parser!(PartialState10; A, B, C, D, E, F, G, H, I, J);
306
tuple_parser!(PartialState11; A, B, C, D, E, F, G, H, I, J, K);
307
tuple_parser!(PartialState12; A, B, C, D, E, F, G, H, I, J, K, L);
308
tuple_parser!(PartialState13; A, B, C, D, E, F, G, H, I, J, K, L, M);
309
tuple_parser!(PartialState14; A, B, C, D, E, F, G, H, I, J, K, L, M, N);
310
tuple_parser!(PartialState15; A, B, C, D, E, F, G, H, I, J, K, L, M, N, P);
311
tuple_parser!(PartialState16; A, B, C, D, E, F, G, H, I, J, K, L, M, N, P, Q);
312
tuple_parser!(PartialState17; A, B, C, D, E, F, G, H, I, J, K, L, M, N, P, Q, R);
313
tuple_parser!(PartialState18; A, B, C, D, E, F, G, H, I, J, K, L, M, N, P, Q, R, S);
314
tuple_parser!(PartialState19; A, B, C, D, E, F, G, H, I, J, K, L, M, N, P, Q, R, S, T);
315
tuple_parser!(PartialState20; A, B, C, D, E, F, G, H, I, J, K, L, M, N, P, Q, R, S, T, U);
316
317
#[macro_export]
318
#[doc(hidden)]
319
macro_rules! seq_parser_expr {
320
    (; $($tt: tt)*) => {
321
        ( $($tt)* )
322
    };
323
    ( (_ : $first_parser: expr, $($remaining: tt)+ ); $($tt: tt)*) => {
324
        $crate::seq_parser_expr!( ( $($remaining)+ ) ; $($tt)* $first_parser, )
325
    };
326
    ( ($first_field: ident : $first_parser: expr, $($remaining: tt)+ ); $($tt: tt)*) => {
327
        $crate::seq_parser_expr!( ( $($remaining)+ ) ; $($tt)* $first_parser, )
328
    };
329
    ( (_ : $first_parser: expr ); $($tt: tt)*) => {
330
        ( $($tt)* $first_parser, )
331
    };
332
    ( ($first_field: ident : $first_parser: expr, ); $($tt: tt)*) => {
333
        $crate::seq_parser_expr!(; $($tt)* $first_parser,)
334
    };
335
    ( (_ : $first_parser: expr, ); $($tt: tt)*) => {
336
        ( $($tt)* $first_parser, )
337
    };
338
    ( ($first_field: ident : $first_parser: expr ); $($tt: tt)*) => {
339
        $crate::seq_parser_expr!(; $($tt)* $first_parser,)
340
    };
341
}
342
343
#[macro_export]
344
#[doc(hidden)]
345
macro_rules! seq_parser_pattern {
346
    (; $($tt: tt)*) => {
347
       ( $($tt)* )
348
    };
349
    ( (_ : $first_parser: expr, $($remaining: tt)+ ); $($tt: tt)*) => {
350
        $crate::seq_parser_pattern!( ( $($remaining)+ ) ; $($tt)* _, )
351
    };
352
    ( ($first_field: ident : $first_parser: expr, $($remaining: tt)+ ); $($tt: tt)*) => {
353
        $crate::seq_parser_pattern!( ( $($remaining)+ ) ; $($tt)* $first_field, )
354
    };
355
    ( ( _ : $first_parser: expr ); $($tt: tt)*) => {
356
        $crate::seq_parser_pattern!(; $($tt)* _, )
357
    };
358
    ( ($first_field: ident : $first_parser: expr ); $($tt: tt)*) => {
359
        $crate::seq_parser_pattern!(; $($tt)* $first_field,)
360
    };
361
    ( ( _ : $first_parser: expr, ); $($tt: tt)*) => {
362
        $crate::seq_parser_pattern!(; $($tt)* _, )
363
    };
364
    ( ($first_field: ident : $first_parser: expr, ); $($tt: tt)*) => {
365
        $crate::seq_parser_pattern!(; $($tt)* $first_field,)
366
    };
367
}
368
369
#[macro_export]
370
#[doc(hidden)]
371
macro_rules! seq_parser_impl {
372
    (; $name: ident $($tt: tt)*) => {
373
        $name { $($tt)* }
374
    };
375
    ( (_ : $first_parser: expr, $($remaining: tt)+ ); $name: ident $($tt: tt)*) => {
376
        $crate::seq_parser_impl!( ( $($remaining)+ ) ; $name $($tt)* )
377
    };
378
    ( ($first_field: ident : $first_parser: expr, $($remaining: tt)+ );
379
        $name: ident $($tt: tt)*) =>
380
    {
381
        $crate::seq_parser_impl!( ( $($remaining)+ ) ; $name $($tt)* $first_field: $first_field, )
382
    };
383
    ( ( _ : $first_parser: expr ); $name: ident $($tt: tt)*) => {
384
        $crate::seq_parser_impl!( ; $name $($tt)* )
385
    };
386
    ( ($first_field: ident : $first_parser: expr ); $name: ident $($tt: tt)*) => {
387
        $crate::seq_parser_impl!(; $name $($tt)* $first_field: $first_field,)
388
    };
389
    ( ( _ : $first_parser: expr, ); $name: ident $($tt: tt)*) => {
390
        $crate::seq_parser_impl!(; $name $($tt)*)
391
    };
392
    ( ($first_field: ident : $first_parser: expr, ); $name: ident $($tt: tt)*) => {
393
        $crate::seq_parser_impl!(; $name $($tt)* $first_field: $first_field,)
394
    };
395
}
396
397
#[macro_export]
398
#[doc(hidden)]
399
macro_rules! seq_tuple_extract {
400
    (; ; $name: ident ;  $($arg: expr),* $(,)? ) => {
401
        $name( $($arg,)* )
402
    };
403
404
    ( (_ : $first_parser: expr, $($remaining: tt)+ ); ( $first_arg: expr, $($arg: expr),* ) ; $($tt: tt)*) => {
405
        $crate::seq_tuple_extract!( ( $($remaining)+ ); ( $($arg),* ) ; $($tt)* )
406
    };
407
408
    ( ($first_parser: expr, $($remaining: tt)+ ); ( $first_arg: expr, $($arg: expr),* ) ; $($tt: tt)*) => {
409
        $crate::seq_tuple_extract!( ( $($remaining)+ ) ; ( $($arg),* ) ; $($tt)* $first_arg, )
410
    };
411
412
    ( (_ : $first_parser: expr $(,)? ); ( $first_arg: expr, $($arg: expr),* ) ; $($tt: tt)*) => {
413
        $crate::seq_tuple_extract!(; ; $($tt)*)
414
    };
415
416
    ( ($first_parser: expr $(,)? ); ( $first_arg: expr, $($arg: expr),* ) ; $($tt: tt)*) => {
417
        $crate::seq_tuple_extract!(; ; $($tt)* $first_arg)
418
    };
419
}
420
421
#[macro_export]
422
#[doc(hidden)]
423
macro_rules! seq_tuple_parser_impl {
424
    (; $($tt: tt)*) => {
425
        ($($tt)*)
426
    };
427
428
    ( (_ : $first_parser: expr, $($remaining: tt)+ ); $($tt: tt)*) => {
429
        $crate::seq_tuple_parser_impl!( ( $($remaining)+ ) ; $($tt)* $first_parser, )
430
    };
431
432
    ( ($first_parser: expr, $($remaining: tt)+ ); $($tt: tt)*) => {
433
        $crate::seq_tuple_parser_impl!( ( $($remaining)+ ) ; $($tt)* $first_parser, )
434
    };
435
436
    ( (_ : $first_parser: expr $(,)? ); $($tt: tt)*) => {
437
        $crate::seq_tuple_parser_impl!(; $($tt)* $first_parser, )
438
    };
439
440
    ( ($first_parser: expr $(,)? ); $($tt: tt)*) => {
441
        $crate::seq_tuple_parser_impl!(; $($tt)* $first_parser, )
442
    };
443
}
444
445
/// Sequences multiple parsers and builds a struct out of them.
446
///
447
/// ```
448
/// use combine::{Parser, between, from_str, many, struct_parser, token};
449
/// use combine::parser::range::take_while1;
450
/// use combine::parser::byte::{letter, spaces};
451
///
452
/// #[derive(Debug, PartialEq)]
453
/// struct Point(u32, u32);
454
///
455
/// #[derive(Debug, PartialEq)]
456
/// struct Field {
457
///     name: Vec<u8>,
458
///     value: Vec<u8>,
459
///     point: Point,
460
/// }
461
/// fn main() {
462
///     let num = || from_str(take_while1(|b: u8| b >= b'0' && b <= b'9'));
463
///     let spaced = |b| between(spaces(), spaces(), token(b));
464
///     let mut parser = struct_parser!{
465
///         Field {
466
///             name: many(letter()),
467
///             // `_` fields are ignored when building the struct
468
///             _: spaced(b':'),
469
///             value: many(letter()),
470
///             _: spaced(b':'),
471
///             point: struct_parser!(Point(num(), _: spaced(b','), num())),
472
///         }
473
///     };
474
///     assert_eq!(
475
///         parser.parse(&b"test: data: 123 , 4"[..]),
476
///         Ok((
477
///             Field {
478
///                 name: b"test"[..].to_owned(),
479
///                 value: b"data"[..].to_owned(),
480
///                 point: Point(123, 4),
481
///             },
482
///             &b""[..]
483
///         )),
484
///     );
485
/// }
486
/// ```
487
#[macro_export]
488
macro_rules! struct_parser {
489
    ($name: ident { $($tt: tt)* }) => {
490
        $crate::seq_parser_expr!( ( $($tt)* ); )
491
            .map(|$crate::seq_parser_pattern!( ( $($tt)* ); )|
492
                $crate::seq_parser_impl!(( $($tt)* ); $name )
493
            )
494
    };
495
496
    ($name: ident ( $($arg: tt)* )) => {
497
        $crate::seq_tuple_parser_impl!( ( $($arg)* ) ; )
498
            .map(|t|
499
                $crate::seq_tuple_extract!(
500
                    ( $($arg)* );
501
                    (t.0, t.1, t.2, t.3, t.4, t.5, t.6, t.7, t.8, t.9, t.10, t.11, t.12, t.13, t.14);
502
                    $name ;
503
                )
504
            )
505
    }
506
}
507
508
#[derive(Copy, Clone)]
509
pub struct With<P1, P2>((Ignore<P1>, P2));
510
impl<Input, P1, P2> Parser<Input> for With<P1, P2>
511
where
512
    Input: Stream,
513
    P1: Parser<Input>,
514
    P2: Parser<Input>,
515
{
516
    type Output = P2::Output;
517
    type PartialState = <(Ignore<P1>, P2) as Parser<Input>>::PartialState;
518
519
    #[inline]
520
156k
    fn parse_lazy(
521
156k
        &mut self,
522
156k
        input: &mut Input,
523
156k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error> {
524
156k
        self.0.parse_lazy(input).map(|(_, b)| b)
525
156k
    }
<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_lazy
Line
Count
Source
520
156k
    fn parse_lazy(
521
156k
        &mut self,
522
156k
        input: &mut Input,
523
156k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error> {
524
156k
        self.0.parse_lazy(input).map(|(_, b)| b)
525
156k
    }
Unexecuted instantiation: <combine::parser::sequence::With<_, _> as combine::parser::Parser<_>>::parse_lazy
526
527
    parse_mode!(Input);
528
    #[inline]
529
8.38M
    fn parse_mode_impl<M>(
530
8.38M
        &mut self,
531
8.38M
        mode: M,
532
8.38M
        input: &mut Input,
533
8.38M
        state: &mut Self::PartialState,
534
8.38M
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
535
8.38M
    where
536
8.38M
        M: ParseMode,
537
    {
538
8.38M
        self.0.parse_mode(mode, input, state).map(|(_, b)| b)
539
8.38M
    }
<combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
529
31.1k
    fn parse_mode_impl<M>(
530
31.1k
        &mut self,
531
31.1k
        mode: M,
532
31.1k
        input: &mut Input,
533
31.1k
        state: &mut Self::PartialState,
534
31.1k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
535
31.1k
    where
536
31.1k
        M: ParseMode,
537
    {
538
31.1k
        self.0.parse_mode(mode, input, state).map(|(_, b)| b)
539
31.1k
    }
<combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
529
8.34M
    fn parse_mode_impl<M>(
530
8.34M
        &mut self,
531
8.34M
        mode: M,
532
8.34M
        input: &mut Input,
533
8.34M
        state: &mut Self::PartialState,
534
8.34M
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
535
8.34M
    where
536
8.34M
        M: ParseMode,
537
    {
538
8.34M
        self.0.parse_mode(mode, input, state).map(|(_, b)| b)
539
8.34M
    }
Unexecuted instantiation: <combine::parser::sequence::With<_, _> as combine::parser::Parser<_>>::parse_mode_impl::<_>
540
541
    forward_parser!(Input, add_error add_committed_expected_error parser_count, 0);
542
}
543
544
/// Equivalent to [`p1.with(p2)`].
545
///
546
/// [`p1.with(p2)`]: ../trait.Parser.html#method.with
547
8.75M
pub fn with<Input, P1, P2>(p1: P1, p2: P2) -> With<P1, P2>
548
8.75M
where
549
8.75M
    Input: Stream,
550
8.75M
    P1: Parser<Input>,
551
8.75M
    P2: Parser<Input>,
552
{
553
8.75M
    With((ignore(p1), p2))
554
8.75M
}
combine::parser::sequence::with::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>
Line
Count
Source
547
8.59M
pub fn with<Input, P1, P2>(p1: P1, p2: P2) -> With<P1, P2>
548
8.59M
where
549
8.59M
    Input: Stream,
550
8.59M
    P1: Parser<Input>,
551
8.59M
    P2: Parser<Input>,
552
{
553
8.59M
    With((ignore(p1), p2))
554
8.59M
}
combine::parser::sequence::with::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>
Line
Count
Source
547
161k
pub fn with<Input, P1, P2>(p1: P1, p2: P2) -> With<P1, P2>
548
161k
where
549
161k
    Input: Stream,
550
161k
    P1: Parser<Input>,
551
161k
    P2: Parser<Input>,
552
{
553
161k
    With((ignore(p1), p2))
554
161k
}
Unexecuted instantiation: combine::parser::sequence::with::<_, _, _>
555
556
#[derive(Copy, Clone)]
557
pub struct Skip<P1, P2>((P1, Ignore<P2>));
558
impl<Input, P1, P2> Parser<Input> for Skip<P1, P2>
559
where
560
    Input: Stream,
561
    P1: Parser<Input>,
562
    P2: Parser<Input>,
563
{
564
    type Output = P1::Output;
565
    type PartialState = <(P1, Ignore<P2>) as Parser<Input>>::PartialState;
566
567
    parse_mode!(Input);
568
    #[inline]
569
161k
    fn parse_mode_impl<M>(
570
161k
        &mut self,
571
161k
        mode: M,
572
161k
        input: &mut Input,
573
161k
        state: &mut Self::PartialState,
574
161k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
575
161k
    where
576
161k
        M: ParseMode,
577
    {
578
161k
        self.0.parse_mode(mode, input, state).map(|(a, _)| a)
579
161k
    }
<combine::parser::sequence::Skip<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
569
1.62k
    fn parse_mode_impl<M>(
570
1.62k
        &mut self,
571
1.62k
        mode: M,
572
1.62k
        input: &mut Input,
573
1.62k
        state: &mut Self::PartialState,
574
1.62k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
575
1.62k
    where
576
1.62k
        M: ParseMode,
577
    {
578
1.62k
        self.0.parse_mode(mode, input, state).map(|(a, _)| a)
579
1.62k
    }
<combine::parser::sequence::Skip<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
569
47.7k
    fn parse_mode_impl<M>(
570
47.7k
        &mut self,
571
47.7k
        mode: M,
572
47.7k
        input: &mut Input,
573
47.7k
        state: &mut Self::PartialState,
574
47.7k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
575
47.7k
    where
576
47.7k
        M: ParseMode,
577
    {
578
47.7k
        self.0.parse_mode(mode, input, state).map(|(a, _)| a)
579
47.7k
    }
<combine::parser::sequence::Skip<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
569
3.74k
    fn parse_mode_impl<M>(
570
3.74k
        &mut self,
571
3.74k
        mode: M,
572
3.74k
        input: &mut Input,
573
3.74k
        state: &mut Self::PartialState,
574
3.74k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
575
3.74k
    where
576
3.74k
        M: ParseMode,
577
    {
578
3.74k
        self.0.parse_mode(mode, input, state).map(|(a, _)| a)
579
3.74k
    }
<combine::parser::sequence::Skip<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
569
108k
    fn parse_mode_impl<M>(
570
108k
        &mut self,
571
108k
        mode: M,
572
108k
        input: &mut Input,
573
108k
        state: &mut Self::PartialState,
574
108k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
575
108k
    where
576
108k
        M: ParseMode,
577
    {
578
108k
        self.0.parse_mode(mode, input, state).map(|(a, _)| a)
579
108k
    }
Unexecuted instantiation: <combine::parser::sequence::Skip<_, _> as combine::parser::Parser<_>>::parse_mode_impl::<_>
580
581
    forward_parser!(Input, add_error add_committed_expected_error parser_count, 0);
582
}
583
584
161k
pub fn skip<Input, P1, P2>(p1: P1, p2: P2) -> Skip<P1, P2>
585
161k
where
586
161k
    Input: Stream,
587
161k
    P1: Parser<Input>,
588
161k
    P2: Parser<Input>,
589
{
590
161k
    Skip((p1, ignore(p2)))
591
161k
}
combine::parser::sequence::skip::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>
Line
Count
Source
584
49.3k
pub fn skip<Input, P1, P2>(p1: P1, p2: P2) -> Skip<P1, P2>
585
49.3k
where
586
49.3k
    Input: Stream,
587
49.3k
    P1: Parser<Input>,
588
49.3k
    P2: Parser<Input>,
589
{
590
49.3k
    Skip((p1, ignore(p2)))
591
49.3k
}
combine::parser::sequence::skip::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>
Line
Count
Source
584
112k
pub fn skip<Input, P1, P2>(p1: P1, p2: P2) -> Skip<P1, P2>
585
112k
where
586
112k
    Input: Stream,
587
112k
    P1: Parser<Input>,
588
112k
    P2: Parser<Input>,
589
{
590
112k
    Skip((p1, ignore(p2)))
591
112k
}
Unexecuted instantiation: combine::parser::sequence::skip::<_, _, _>
592
593
parser! {
594
    #[derive(Copy, Clone)]
595
    pub struct Between;
596
    type PartialState = <Map<(L, P, R), fn ((L::Output, P::Output, R::Output)) -> P::Output> as Parser<Input>>::PartialState;
597
/// Parses `open` followed by `parser` followed by `close`.
598
/// Returns the value of `parser`.
599
///
600
/// ```
601
/// # extern crate combine;
602
/// # use combine::*;
603
/// # use combine::parser::char::string;
604
/// # fn main() {
605
/// let result = between(token('['), token(']'), string("rust"))
606
///     .parse("[rust]")
607
///     .map(|x| x.0);
608
/// assert_eq!(result, Ok("rust"));
609
/// # }
610
/// ```
611
pub fn between[Input, L, R, P](open: L, close: R, parser: P)(Input) -> P::Output
612
where [
613
    Input: Stream,
614
    L: Parser< Input>,
615
    R: Parser< Input>,
616
    P: Parser< Input>,
617
]
618
{
619
0
    fn middle<T, U, V>((_, x, _): (T, U, V)) -> U {
620
0
        x
621
0
    }
Unexecuted instantiation: <combine::parser::sequence::Between<_, _, _, _> as combine::parser::Parser<_>>::parse_mode_impl::middle::<_, _, _>
Unexecuted instantiation: <combine::parser::sequence::Between<_, _, _, _> as combine::parser::Parser<_>>::add_committed_expected_error::middle::<_, _, _>
Unexecuted instantiation: <combine::parser::sequence::Between<_, _, _, _> as combine::parser::Parser<_>>::add_error::middle::<_, _, _>
622
    (open, parser, close).map(middle)
623
}
624
}
625
626
#[derive(Copy, Clone)]
627
pub struct Then<P, F>(P, F);
628
impl<Input, P, N, F> Parser<Input> for Then<P, F>
629
where
630
    Input: Stream,
631
    F: FnMut(P::Output) -> N,
632
    P: Parser<Input>,
633
    N: Parser<Input>,
634
{
635
    type Output = N::Output;
636
    type PartialState = (P::PartialState, Option<(bool, N)>, N::PartialState);
637
638
    parse_mode!(Input);
639
    #[inline]
640
0
    fn parse_mode_impl<M>(
641
0
        &mut self,
642
0
        mut mode: M,
643
0
        input: &mut Input,
644
0
        state: &mut Self::PartialState,
645
0
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
646
0
    where
647
0
        M: ParseMode,
648
    {
649
0
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
650
651
0
        if mode.is_first() || n_parser_cache.is_none() {
652
0
            debug_assert!(n_parser_cache.is_none());
653
654
0
            let (value, committed) = match self.0.parse_mode(mode, input, p_state) {
655
0
                PeekOk(value) => (value, false),
656
0
                CommitOk(value) => (value, true),
657
658
0
                PeekErr(err) => return PeekErr(err),
659
0
                CommitErr(err) => return CommitErr(err),
660
            };
661
662
0
            *n_parser_cache = Some((committed, (self.1)(value)));
663
0
            mode.set_first();
664
0
        }
665
666
0
        let result = n_parser_cache
667
0
            .as_mut()
668
0
            .unwrap()
669
0
            .1
670
0
            .parse_committed_mode(mode, input, n_state);
671
0
        match result {
672
0
            PeekOk(x) => {
673
0
                let (committed, _) = *n_parser_cache.as_ref().unwrap();
674
0
                *n_parser_cache = None;
675
0
                if committed {
676
0
                    CommitOk(x)
677
                } else {
678
0
                    PeekOk(x)
679
                }
680
            }
681
0
            CommitOk(x) => {
682
0
                *n_parser_cache = None;
683
0
                CommitOk(x)
684
            }
685
0
            PeekErr(x) => {
686
0
                let (committed, _) = *n_parser_cache.as_ref().unwrap();
687
0
                *n_parser_cache = None;
688
0
                if committed {
689
0
                    CommitErr(x.error)
690
                } else {
691
0
                    PeekErr(x)
692
                }
693
            }
694
0
            CommitErr(x) => CommitErr(x),
695
        }
696
0
    }
697
698
0
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
699
0
        self.0.add_error(errors);
700
0
    }
701
}
702
703
/// Equivalent to [`p.then(f)`].
704
///
705
/// [`p.then(f)`]: ../trait.Parser.html#method.then
706
0
pub fn then<Input, P, F, N>(p: P, f: F) -> Then<P, F>
707
0
where
708
0
    Input: Stream,
709
0
    F: FnMut(P::Output) -> N,
710
0
    P: Parser<Input>,
711
0
    N: Parser<Input>,
712
{
713
0
    Then(p, f)
714
0
}
715
716
#[derive(Copy, Clone)]
717
pub struct ThenPartial<P, F>(P, F);
718
impl<Input, P, N, F> Parser<Input> for ThenPartial<P, F>
719
where
720
    Input: Stream,
721
    F: FnMut(&mut P::Output) -> N,
722
    P: Parser<Input>,
723
    N: Parser<Input>,
724
{
725
    type Output = N::Output;
726
    type PartialState = (P::PartialState, Option<(bool, P::Output)>, N::PartialState);
727
728
    parse_mode!(Input);
729
    #[inline]
730
17.8M
    fn parse_mode_impl<M>(
731
17.8M
        &mut self,
732
17.8M
        mut mode: M,
733
17.8M
        input: &mut Input,
734
17.8M
        state: &mut Self::PartialState,
735
17.8M
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
17.8M
    where
737
17.8M
        M: ParseMode,
738
    {
739
17.8M
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
17.8M
        if mode.is_first() || n_parser_cache.is_none() {
742
17.4M
            debug_assert!(n_parser_cache.is_none());
743
744
17.4M
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
17.3M
                CommitOk(value) => {
749
17.3M
                    *n_parser_cache = Some((true, value));
750
17.3M
                }
751
3.45k
                PeekErr(err) => return PeekErr(err),
752
28.7k
                CommitErr(err) => return CommitErr(err),
753
            }
754
17.3M
            mode.set_first();
755
453k
        }
756
757
17.8M
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
17.8M
            .parse_committed_mode(mode, input, n_state);
759
17.8M
        match result {
760
8.61M
            PeekOk(x) => {
761
8.61M
                let (committed, _) = n_parser_cache.take().unwrap();
762
8.61M
                if committed {
763
8.61M
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
8.72M
            CommitOk(x) => {
769
8.72M
                *n_parser_cache = None;
770
8.72M
                CommitOk(x)
771
            }
772
3.39k
            PeekErr(x) => {
773
3.39k
                let (committed, _) = n_parser_cache.take().unwrap();
774
3.39k
                if committed {
775
3.39k
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
501k
            CommitErr(x) => CommitErr(x),
781
        }
782
17.8M
    }
<combine::parser::sequence::ThenPartial<combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
260k
    fn parse_mode_impl<M>(
731
260k
        &mut self,
732
260k
        mut mode: M,
733
260k
        input: &mut Input,
734
260k
        state: &mut Self::PartialState,
735
260k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
260k
    where
737
260k
        M: ParseMode,
738
    {
739
260k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
260k
        if mode.is_first() || n_parser_cache.is_none() {
742
18.2k
            debug_assert!(n_parser_cache.is_none());
743
744
18.2k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
8.80k
                CommitOk(value) => {
749
8.80k
                    *n_parser_cache = Some((true, value));
750
8.80k
                }
751
1.51k
                PeekErr(err) => return PeekErr(err),
752
7.88k
                CommitErr(err) => return CommitErr(err),
753
            }
754
8.80k
            mode.set_first();
755
242k
        }
756
757
251k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
251k
            .parse_committed_mode(mode, input, n_state);
759
251k
        match result {
760
0
            PeekOk(x) => {
761
0
                let (committed, _) = n_parser_cache.take().unwrap();
762
0
                if committed {
763
0
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
27.3k
            CommitOk(x) => {
769
27.3k
                *n_parser_cache = None;
770
27.3k
                CommitOk(x)
771
            }
772
720
            PeekErr(x) => {
773
720
                let (committed, _) = n_parser_cache.take().unwrap();
774
720
                if committed {
775
720
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
223k
            CommitErr(x) => CommitErr(x),
781
        }
782
260k
    }
<combine::parser::sequence::ThenPartial<combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
8.34M
    fn parse_mode_impl<M>(
731
8.34M
        &mut self,
732
8.34M
        mut mode: M,
733
8.34M
        input: &mut Input,
734
8.34M
        state: &mut Self::PartialState,
735
8.34M
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
8.34M
    where
737
8.34M
        M: ParseMode,
738
    {
739
8.34M
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
8.34M
        if mode.is_first() || n_parser_cache.is_none() {
742
8.34M
            debug_assert!(n_parser_cache.is_none());
743
744
8.34M
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
8.34M
                CommitOk(value) => {
749
8.34M
                    *n_parser_cache = Some((true, value));
750
8.34M
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
2.33k
                CommitErr(err) => return CommitErr(err),
753
            }
754
8.34M
            mode.set_first();
755
0
        }
756
757
8.34M
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
8.34M
            .parse_committed_mode(mode, input, n_state);
759
8.34M
        match result {
760
0
            PeekOk(x) => {
761
0
                let (committed, _) = n_parser_cache.take().unwrap();
762
0
                if committed {
763
0
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
8.29M
            CommitOk(x) => {
769
8.29M
                *n_parser_cache = None;
770
8.29M
                CommitOk(x)
771
            }
772
295
            PeekErr(x) => {
773
295
                let (committed, _) = n_parser_cache.take().unwrap();
774
295
                if committed {
775
295
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
45.5k
            CommitErr(x) => CommitErr(x),
781
        }
782
8.34M
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
3.47k
    fn parse_mode_impl<M>(
731
3.47k
        &mut self,
732
3.47k
        mut mode: M,
733
3.47k
        input: &mut Input,
734
3.47k
        state: &mut Self::PartialState,
735
3.47k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
3.47k
    where
737
3.47k
        M: ParseMode,
738
    {
739
3.47k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
3.47k
        if mode.is_first() || n_parser_cache.is_none() {
742
1.85k
            debug_assert!(n_parser_cache.is_none());
743
744
1.85k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
894
                CommitOk(value) => {
749
894
                    *n_parser_cache = Some((true, value));
750
894
                }
751
11
                PeekErr(err) => return PeekErr(err),
752
948
                CommitErr(err) => return CommitErr(err),
753
            }
754
894
            mode.set_first();
755
1.62k
        }
756
757
2.51k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
2.51k
            .parse_committed_mode(mode, input, n_state);
759
2.51k
        match result {
760
723
            PeekOk(x) => {
761
723
                let (committed, _) = n_parser_cache.take().unwrap();
762
723
                if committed {
763
723
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
455
            CommitOk(x) => {
769
455
                *n_parser_cache = None;
770
455
                CommitOk(x)
771
            }
772
250
            PeekErr(x) => {
773
250
                let (committed, _) = n_parser_cache.take().unwrap();
774
250
                if committed {
775
250
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
1.09k
            CommitErr(x) => CommitErr(x),
781
        }
782
3.47k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
135k
    fn parse_mode_impl<M>(
731
135k
        &mut self,
732
135k
        mut mode: M,
733
135k
        input: &mut Input,
734
135k
        state: &mut Self::PartialState,
735
135k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
135k
    where
737
135k
        M: ParseMode,
738
    {
739
135k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
135k
        if mode.is_first() || n_parser_cache.is_none() {
742
135k
            debug_assert!(n_parser_cache.is_none());
743
744
135k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
134k
                CommitOk(value) => {
749
134k
                    *n_parser_cache = Some((true, value));
750
134k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
1.02k
                CommitErr(err) => return CommitErr(err),
753
            }
754
134k
            mode.set_first();
755
0
        }
756
757
134k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
134k
            .parse_committed_mode(mode, input, n_state);
759
134k
        match result {
760
87.0k
            PeekOk(x) => {
761
87.0k
                let (committed, _) = n_parser_cache.take().unwrap();
762
87.0k
                if committed {
763
87.0k
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
46.9k
            CommitOk(x) => {
769
46.9k
                *n_parser_cache = None;
770
46.9k
                CommitOk(x)
771
            }
772
36
            PeekErr(x) => {
773
36
                let (committed, _) = n_parser_cache.take().unwrap();
774
36
                if committed {
775
36
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
654
            CommitErr(x) => CommitErr(x),
781
        }
782
135k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
4.69k
    fn parse_mode_impl<M>(
731
4.69k
        &mut self,
732
4.69k
        mut mode: M,
733
4.69k
        input: &mut Input,
734
4.69k
        state: &mut Self::PartialState,
735
4.69k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
4.69k
    where
737
4.69k
        M: ParseMode,
738
    {
739
4.69k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
4.69k
        if mode.is_first() || n_parser_cache.is_none() {
742
947
            debug_assert!(n_parser_cache.is_none());
743
744
947
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
137
                CommitOk(value) => {
749
137
                    *n_parser_cache = Some((true, value));
750
137
                }
751
32
                PeekErr(err) => return PeekErr(err),
752
778
                CommitErr(err) => return CommitErr(err),
753
            }
754
137
            mode.set_first();
755
3.74k
        }
756
757
3.88k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
3.88k
            .parse_committed_mode(mode, input, n_state);
759
3.88k
        match result {
760
0
            PeekOk(x) => {
761
0
                let (committed, _) = n_parser_cache.take().unwrap();
762
0
                if committed {
763
0
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
863
            CommitOk(x) => {
769
863
                *n_parser_cache = None;
770
863
                CommitOk(x)
771
            }
772
251
            PeekErr(x) => {
773
251
                let (committed, _) = n_parser_cache.take().unwrap();
774
251
                if committed {
775
251
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
2.76k
            CommitErr(x) => CommitErr(x),
781
        }
782
4.69k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
108k
    fn parse_mode_impl<M>(
731
108k
        &mut self,
732
108k
        mut mode: M,
733
108k
        input: &mut Input,
734
108k
        state: &mut Self::PartialState,
735
108k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
108k
    where
737
108k
        M: ParseMode,
738
    {
739
108k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
108k
        if mode.is_first() || n_parser_cache.is_none() {
742
108k
            debug_assert!(n_parser_cache.is_none());
743
744
108k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
108k
                CommitOk(value) => {
749
108k
                    *n_parser_cache = Some((true, value));
750
108k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
315
                CommitErr(err) => return CommitErr(err),
753
            }
754
108k
            mode.set_first();
755
0
        }
756
757
108k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
108k
            .parse_committed_mode(mode, input, n_state);
759
108k
        match result {
760
0
            PeekOk(x) => {
761
0
                let (committed, _) = n_parser_cache.take().unwrap();
762
0
                if committed {
763
0
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
107k
            CommitOk(x) => {
769
107k
                *n_parser_cache = None;
770
107k
                CommitOk(x)
771
            }
772
37
            PeekErr(x) => {
773
37
                let (committed, _) = n_parser_cache.take().unwrap();
774
37
                if committed {
775
37
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
1.07k
            CommitErr(x) => CommitErr(x),
781
        }
782
108k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#5}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
53.7k
    fn parse_mode_impl<M>(
731
53.7k
        &mut self,
732
53.7k
        mut mode: M,
733
53.7k
        input: &mut Input,
734
53.7k
        state: &mut Self::PartialState,
735
53.7k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
53.7k
    where
737
53.7k
        M: ParseMode,
738
    {
739
53.7k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
53.7k
        if mode.is_first() || n_parser_cache.is_none() {
742
1.14k
            debug_assert!(n_parser_cache.is_none());
743
744
1.14k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
234
                CommitOk(value) => {
749
234
                    *n_parser_cache = Some((true, value));
750
234
                }
751
24
                PeekErr(err) => return PeekErr(err),
752
887
                CommitErr(err) => return CommitErr(err),
753
            }
754
234
            mode.set_first();
755
52.5k
        }
756
757
52.8k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
52.8k
            .parse_committed_mode(mode, input, n_state);
759
52.8k
        match result {
760
223
            PeekOk(x) => {
761
223
                let (committed, _) = n_parser_cache.take().unwrap();
762
223
                if committed {
763
223
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
2.13k
            CommitOk(x) => {
769
2.13k
                *n_parser_cache = None;
770
2.13k
                CommitOk(x)
771
            }
772
327
            PeekErr(x) => {
773
327
                let (committed, _) = n_parser_cache.take().unwrap();
774
327
                if committed {
775
327
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
50.1k
            CommitErr(x) => CommitErr(x),
781
        }
782
53.7k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#5}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
64.5k
    fn parse_mode_impl<M>(
731
64.5k
        &mut self,
732
64.5k
        mut mode: M,
733
64.5k
        input: &mut Input,
734
64.5k
        state: &mut Self::PartialState,
735
64.5k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
64.5k
    where
737
64.5k
        M: ParseMode,
738
    {
739
64.5k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
64.5k
        if mode.is_first() || n_parser_cache.is_none() {
742
64.5k
            debug_assert!(n_parser_cache.is_none());
743
744
64.5k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
63.9k
                CommitOk(value) => {
749
63.9k
                    *n_parser_cache = Some((true, value));
750
63.9k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
521
                CommitErr(err) => return CommitErr(err),
753
            }
754
63.9k
            mode.set_first();
755
0
        }
756
757
63.9k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
63.9k
            .parse_committed_mode(mode, input, n_state);
759
63.9k
        match result {
760
43.4k
            PeekOk(x) => {
761
43.4k
                let (committed, _) = n_parser_cache.take().unwrap();
762
43.4k
                if committed {
763
43.4k
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
12.3k
            CommitOk(x) => {
769
12.3k
                *n_parser_cache = None;
770
12.3k
                CommitOk(x)
771
            }
772
0
            PeekErr(x) => {
773
0
                let (committed, _) = n_parser_cache.take().unwrap();
774
0
                if committed {
775
0
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
8.22k
            CommitErr(x) => CommitErr(x),
781
        }
782
64.5k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#7}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
90.1k
    fn parse_mode_impl<M>(
731
90.1k
        &mut self,
732
90.1k
        mut mode: M,
733
90.1k
        input: &mut Input,
734
90.1k
        state: &mut Self::PartialState,
735
90.1k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
90.1k
    where
737
90.1k
        M: ParseMode,
738
    {
739
90.1k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
90.1k
        if mode.is_first() || n_parser_cache.is_none() {
742
1.13k
            debug_assert!(n_parser_cache.is_none());
743
744
1.13k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
190
                CommitOk(value) => {
749
190
                    *n_parser_cache = Some((true, value));
750
190
                }
751
167
                PeekErr(err) => return PeekErr(err),
752
776
                CommitErr(err) => return CommitErr(err),
753
            }
754
190
            mode.set_first();
755
89.0k
        }
756
757
89.2k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
89.2k
            .parse_committed_mode(mode, input, n_state);
759
89.2k
        match result {
760
100
            PeekOk(x) => {
761
100
                let (committed, _) = n_parser_cache.take().unwrap();
762
100
                if committed {
763
100
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
2.18k
            CommitOk(x) => {
769
2.18k
                *n_parser_cache = None;
770
2.18k
                CommitOk(x)
771
            }
772
594
            PeekErr(x) => {
773
594
                let (committed, _) = n_parser_cache.take().unwrap();
774
594
                if committed {
775
594
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
86.3k
            CommitErr(x) => CommitErr(x),
781
        }
782
90.1k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#7}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
140k
    fn parse_mode_impl<M>(
731
140k
        &mut self,
732
140k
        mut mode: M,
733
140k
        input: &mut Input,
734
140k
        state: &mut Self::PartialState,
735
140k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
140k
    where
737
140k
        M: ParseMode,
738
    {
739
140k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
140k
        if mode.is_first() || n_parser_cache.is_none() {
742
140k
            debug_assert!(n_parser_cache.is_none());
743
744
140k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
140k
                CommitOk(value) => {
749
140k
                    *n_parser_cache = Some((true, value));
750
140k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
364
                CommitErr(err) => return CommitErr(err),
753
            }
754
140k
            mode.set_first();
755
0
        }
756
757
140k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
140k
            .parse_committed_mode(mode, input, n_state);
759
140k
        match result {
760
80.9k
            PeekOk(x) => {
761
80.9k
                let (committed, _) = n_parser_cache.take().unwrap();
762
80.9k
                if committed {
763
80.9k
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
50.9k
            CommitOk(x) => {
769
50.9k
                *n_parser_cache = None;
770
50.9k
                CommitOk(x)
771
            }
772
122
            PeekErr(x) => {
773
122
                let (committed, _) = n_parser_cache.take().unwrap();
774
122
                if committed {
775
122
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
8.11k
            CommitErr(x) => CommitErr(x),
781
        }
782
140k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#8}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
25.9k
    fn parse_mode_impl<M>(
731
25.9k
        &mut self,
732
25.9k
        mut mode: M,
733
25.9k
        input: &mut Input,
734
25.9k
        state: &mut Self::PartialState,
735
25.9k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
25.9k
    where
737
25.9k
        M: ParseMode,
738
    {
739
25.9k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
25.9k
        if mode.is_first() || n_parser_cache.is_none() {
742
591
            debug_assert!(n_parser_cache.is_none());
743
744
591
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
84
                CommitOk(value) => {
749
84
                    *n_parser_cache = Some((true, value));
750
84
                }
751
109
                PeekErr(err) => return PeekErr(err),
752
398
                CommitErr(err) => return CommitErr(err),
753
            }
754
84
            mode.set_first();
755
25.3k
        }
756
757
25.4k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
25.4k
            .parse_committed_mode(mode, input, n_state);
759
25.4k
        match result {
760
0
            PeekOk(x) => {
761
0
                let (committed, _) = n_parser_cache.take().unwrap();
762
0
                if committed {
763
0
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
4.04k
            CommitOk(x) => {
769
4.04k
                *n_parser_cache = None;
770
4.04k
                CommitOk(x)
771
            }
772
272
            PeekErr(x) => {
773
272
                let (committed, _) = n_parser_cache.take().unwrap();
774
272
                if committed {
775
272
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
21.1k
            CommitErr(x) => CommitErr(x),
781
        }
782
25.9k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#8}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
62.6k
    fn parse_mode_impl<M>(
731
62.6k
        &mut self,
732
62.6k
        mut mode: M,
733
62.6k
        input: &mut Input,
734
62.6k
        state: &mut Self::PartialState,
735
62.6k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
62.6k
    where
737
62.6k
        M: ParseMode,
738
    {
739
62.6k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
62.6k
        if mode.is_first() || n_parser_cache.is_none() {
742
62.6k
            debug_assert!(n_parser_cache.is_none());
743
744
62.6k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
62.4k
                CommitOk(value) => {
749
62.4k
                    *n_parser_cache = Some((true, value));
750
62.4k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
218
                CommitErr(err) => return CommitErr(err),
753
            }
754
62.4k
            mode.set_first();
755
0
        }
756
757
62.4k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
62.4k
            .parse_committed_mode(mode, input, n_state);
759
62.4k
        match result {
760
0
            PeekOk(x) => {
761
0
                let (committed, _) = n_parser_cache.take().unwrap();
762
0
                if committed {
763
0
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
53.5k
            CommitOk(x) => {
769
53.5k
                *n_parser_cache = None;
770
53.5k
                CommitOk(x)
771
            }
772
117
            PeekErr(x) => {
773
117
                let (committed, _) = n_parser_cache.take().unwrap();
774
117
                if committed {
775
117
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
8.79k
            CommitErr(x) => CommitErr(x),
781
        }
782
62.6k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#9}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
19.9k
    fn parse_mode_impl<M>(
731
19.9k
        &mut self,
732
19.9k
        mut mode: M,
733
19.9k
        input: &mut Input,
734
19.9k
        state: &mut Self::PartialState,
735
19.9k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
19.9k
    where
737
19.9k
        M: ParseMode,
738
    {
739
19.9k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
19.9k
        if mode.is_first() || n_parser_cache.is_none() {
742
877
            debug_assert!(n_parser_cache.is_none());
743
744
877
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
277
                CommitOk(value) => {
749
277
                    *n_parser_cache = Some((true, value));
750
277
                }
751
29
                PeekErr(err) => return PeekErr(err),
752
571
                CommitErr(err) => return CommitErr(err),
753
            }
754
277
            mode.set_first();
755
19.0k
        }
756
757
19.3k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
19.3k
            .parse_committed_mode(mode, input, n_state);
759
19.3k
        match result {
760
275
            PeekOk(x) => {
761
275
                let (committed, _) = n_parser_cache.take().unwrap();
762
275
                if committed {
763
275
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
1.34k
            CommitOk(x) => {
769
1.34k
                *n_parser_cache = None;
770
1.34k
                CommitOk(x)
771
            }
772
172
            PeekErr(x) => {
773
172
                let (committed, _) = n_parser_cache.take().unwrap();
774
172
                if committed {
775
172
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
17.5k
            CommitErr(x) => CommitErr(x),
781
        }
782
19.9k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#9}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
32.4k
    fn parse_mode_impl<M>(
731
32.4k
        &mut self,
732
32.4k
        mut mode: M,
733
32.4k
        input: &mut Input,
734
32.4k
        state: &mut Self::PartialState,
735
32.4k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
32.4k
    where
737
32.4k
        M: ParseMode,
738
    {
739
32.4k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
32.4k
        if mode.is_first() || n_parser_cache.is_none() {
742
32.4k
            debug_assert!(n_parser_cache.is_none());
743
744
32.4k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
31.9k
                CommitOk(value) => {
749
31.9k
                    *n_parser_cache = Some((true, value));
750
31.9k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
524
                CommitErr(err) => return CommitErr(err),
753
            }
754
31.9k
            mode.set_first();
755
0
        }
756
757
31.9k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
31.9k
            .parse_committed_mode(mode, input, n_state);
759
31.9k
        match result {
760
23.9k
            PeekOk(x) => {
761
23.9k
                let (committed, _) = n_parser_cache.take().unwrap();
762
23.9k
                if committed {
763
23.9k
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
4.45k
            CommitOk(x) => {
769
4.45k
                *n_parser_cache = None;
770
4.45k
                CommitOk(x)
771
            }
772
0
            PeekErr(x) => {
773
0
                let (committed, _) = n_parser_cache.take().unwrap();
774
0
                if committed {
775
0
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
3.55k
            CommitErr(x) => CommitErr(x),
781
        }
782
32.4k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
20.5k
    fn parse_mode_impl<M>(
731
20.5k
        &mut self,
732
20.5k
        mut mode: M,
733
20.5k
        input: &mut Input,
734
20.5k
        state: &mut Self::PartialState,
735
20.5k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
20.5k
    where
737
20.5k
        M: ParseMode,
738
    {
739
20.5k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
20.5k
        if mode.is_first() || n_parser_cache.is_none() {
742
789
            debug_assert!(n_parser_cache.is_none());
743
744
789
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
218
                CommitOk(value) => {
749
218
                    *n_parser_cache = Some((true, value));
750
218
                }
751
44
                PeekErr(err) => return PeekErr(err),
752
527
                CommitErr(err) => return CommitErr(err),
753
            }
754
218
            mode.set_first();
755
19.7k
        }
756
757
19.9k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
19.9k
            .parse_committed_mode(mode, input, n_state);
759
19.9k
        match result {
760
189
            PeekOk(x) => {
761
189
                let (committed, _) = n_parser_cache.take().unwrap();
762
189
                if committed {
763
189
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
2.44k
            CommitOk(x) => {
769
2.44k
                *n_parser_cache = None;
770
2.44k
                CommitOk(x)
771
            }
772
187
            PeekErr(x) => {
773
187
                let (committed, _) = n_parser_cache.take().unwrap();
774
187
                if committed {
775
187
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
17.1k
            CommitErr(x) => CommitErr(x),
781
        }
782
20.5k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
149k
    fn parse_mode_impl<M>(
731
149k
        &mut self,
732
149k
        mut mode: M,
733
149k
        input: &mut Input,
734
149k
        state: &mut Self::PartialState,
735
149k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
149k
    where
737
149k
        M: ParseMode,
738
    {
739
149k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
149k
        if mode.is_first() || n_parser_cache.is_none() {
742
149k
            debug_assert!(n_parser_cache.is_none());
743
744
149k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
148k
                CommitOk(value) => {
749
148k
                    *n_parser_cache = Some((true, value));
750
148k
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
429
                CommitErr(err) => return CommitErr(err),
753
            }
754
148k
            mode.set_first();
755
0
        }
756
757
148k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
148k
            .parse_committed_mode(mode, input, n_state);
759
148k
        match result {
760
27.7k
            PeekOk(x) => {
761
27.7k
                let (committed, _) = n_parser_cache.take().unwrap();
762
27.7k
                if committed {
763
27.7k
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
114k
            CommitOk(x) => {
769
114k
                *n_parser_cache = None;
770
114k
                CommitOk(x)
771
            }
772
0
            PeekErr(x) => {
773
0
                let (committed, _) = n_parser_cache.take().unwrap();
774
0
                if committed {
775
0
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
6.38k
            CommitErr(x) => CommitErr(x),
781
        }
782
149k
    }
<combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::PartialMode>
Line
Count
Source
730
18.2k
    fn parse_mode_impl<M>(
731
18.2k
        &mut self,
732
18.2k
        mut mode: M,
733
18.2k
        input: &mut Input,
734
18.2k
        state: &mut Self::PartialState,
735
18.2k
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
18.2k
    where
737
18.2k
        M: ParseMode,
738
    {
739
18.2k
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
18.2k
        if mode.is_first() || n_parser_cache.is_none() {
742
18.2k
            debug_assert!(n_parser_cache.is_none());
743
744
18.2k
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
8.81k
                CommitOk(value) => {
749
8.81k
                    *n_parser_cache = Some((true, value));
750
8.81k
                }
751
1.51k
                PeekErr(err) => return PeekErr(err),
752
7.88k
                CommitErr(err) => return CommitErr(err),
753
            }
754
8.81k
            mode.set_first();
755
0
        }
756
757
8.81k
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
8.81k
            .parse_committed_mode(mode, input, n_state);
759
8.81k
        match result {
760
8.80k
            PeekOk(x) => {
761
8.80k
                let (committed, _) = n_parser_cache.take().unwrap();
762
8.80k
                if committed {
763
8.80k
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
0
            CommitOk(x) => {
769
0
                *n_parser_cache = None;
770
0
                CommitOk(x)
771
            }
772
4
            PeekErr(x) => {
773
4
                let (committed, _) = n_parser_cache.take().unwrap();
774
4
                if committed {
775
4
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
0
            CommitErr(x) => CommitErr(x),
781
        }
782
18.2k
    }
<combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::parse_mode_impl::<combine::parser::FirstMode>
Line
Count
Source
730
8.34M
    fn parse_mode_impl<M>(
731
8.34M
        &mut self,
732
8.34M
        mut mode: M,
733
8.34M
        input: &mut Input,
734
8.34M
        state: &mut Self::PartialState,
735
8.34M
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
736
8.34M
    where
737
8.34M
        M: ParseMode,
738
    {
739
8.34M
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
740
741
8.34M
        if mode.is_first() || n_parser_cache.is_none() {
742
8.34M
            debug_assert!(n_parser_cache.is_none());
743
744
8.34M
            match self.0.parse_mode(mode, input, p_state) {
745
0
                PeekOk(value) => {
746
0
                    *n_parser_cache = Some((false, value));
747
0
                }
748
8.34M
                CommitOk(value) => {
749
8.34M
                    *n_parser_cache = Some((true, value));
750
8.34M
                }
751
0
                PeekErr(err) => return PeekErr(err),
752
2.32k
                CommitErr(err) => return CommitErr(err),
753
            }
754
8.34M
            mode.set_first();
755
0
        }
756
757
8.34M
        let result = (self.1)(&mut n_parser_cache.as_mut().unwrap().1)
758
8.34M
            .parse_committed_mode(mode, input, n_state);
759
8.34M
        match result {
760
8.34M
            PeekOk(x) => {
761
8.34M
                let (committed, _) = n_parser_cache.take().unwrap();
762
8.34M
                if committed {
763
8.34M
                    CommitOk(x)
764
                } else {
765
0
                    PeekOk(x)
766
                }
767
            }
768
0
            CommitOk(x) => {
769
0
                *n_parser_cache = None;
770
0
                CommitOk(x)
771
            }
772
13
            PeekErr(x) => {
773
13
                let (committed, _) = n_parser_cache.take().unwrap();
774
13
                if committed {
775
13
                    CommitErr(x.error)
776
                } else {
777
0
                    PeekErr(x)
778
                }
779
            }
780
0
            CommitErr(x) => CommitErr(x),
781
        }
782
8.34M
    }
Unexecuted instantiation: <combine::parser::sequence::ThenPartial<_, _> as combine::parser::Parser<_>>::parse_mode_impl::<_>
783
784
3.45k
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
3.45k
        self.0.add_error(errors);
786
3.45k
    }
<combine::parser::sequence::ThenPartial<combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
1.51k
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
1.51k
        self.0.add_error(errors);
786
1.51k
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
11
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
11
        self.0.add_error(errors);
786
11
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
32
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
32
        self.0.add_error(errors);
786
32
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#5}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
24
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
24
        self.0.add_error(errors);
786
24
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#7}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
167
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
167
        self.0.add_error(errors);
786
167
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#8}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
109
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
109
        self.0.add_error(errors);
786
109
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#9}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
29
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
29
        self.0.add_error(errors);
786
29
    }
<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
44
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
44
        self.0.add_error(errors);
786
44
    }
<combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}> as combine::parser::Parser<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>>::add_error
Line
Count
Source
784
1.51k
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
785
1.51k
        self.0.add_error(errors);
786
1.51k
    }
Unexecuted instantiation: <combine::parser::sequence::ThenPartial<_, _> as combine::parser::Parser<_>>::add_error
787
}
788
789
/// Equivalent to [`p.then_partial(f)`].
790
///
791
/// [`p.then_partial(f)`]: ../trait.Parser.html#method.then_partial
792
18.1M
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
18.1M
where
794
18.1M
    Input: Stream,
795
18.1M
    F: FnMut(&mut P::Output) -> N,
796
18.1M
    P: Parser<Input>,
797
18.1M
    N: Parser<Input>,
798
{
799
18.1M
    ThenPartial(p, f)
800
18.1M
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::ThenPartial<combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}, redis::parser::value::{closure#0}::{closure#1}::Dispatch<combine::parser::combinator::Map<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#1}::{closure#0}>, combine::parser::combinator::Map<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::types::Value::Int>, combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}>, combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#5}::{closure#0}>, combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#7}::{closure#0}>, combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#8}::{closure#0}>, combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#9}::{closure#0}>, combine::parser::combinator::Map<combine::parser::combinator::Map<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::err_parser>, redis::types::Value::ServerError>, combine::parser::combinator::Map<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#11}::{closure#0}>, combine::parser::combinator::Map<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#12}::{closure#0}>, redis::types::Value::Double>, combine::parser::combinator::Map<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#13}::{closure#0}>, redis::types::Value::Boolean>, combine::parser::combinator::Map<combine::parser::combinator::Map<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#14}::{closure#0}>, redis::types::Value::ServerError>, combine::parser::combinator::AndThen<combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#15}::{closure#0}>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#16}::{closure#0}>, combine::parser::sequence::ThenPartial<combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}>, combine::parser::error::Unexpected<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, combine::error::Token<u8>>>>
Line
Count
Source
792
8.60M
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
8.60M
where
794
8.60M
    Input: Stream,
795
8.60M
    F: FnMut(&mut P::Output) -> N,
796
8.60M
    P: Parser<Input>,
797
8.60M
    N: Parser<Input>,
798
{
799
8.60M
    ThenPartial(p, f)
800
8.60M
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}, combine::parser::combinator::Either<combine::parser::token::Produce<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#0}>, combine::parser::sequence::Skip<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#3}::{closure#0}::{closure#1}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>>>
Line
Count
Source
792
139k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
139k
where
794
139k
    Input: Stream,
795
139k
    F: FnMut(&mut P::Output) -> N,
796
139k
    P: Parser<Input>,
797
139k
    N: Parser<Input>,
798
{
799
139k
    ThenPartial(p, f)
800
139k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}, combine::parser::sequence::Skip<combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#4}::{closure#0}::{closure#0}>, combine::parser::error::Expected<combine::parser::combinator::NoPartial<combine::parser::sequence::With<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::crlf<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, combine::parser::error::Expected<combine::parser::token::Satisfy<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::byte::newline<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}>, &str>>>, &str>>>
Line
Count
Source
792
113k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
113k
where
794
113k
    Input: Stream,
795
113k
    F: FnMut(&mut P::Output) -> N,
796
113k
    P: Parser<Input>,
797
113k
    N: Parser<Input>,
798
{
799
113k
    ThenPartial(p, f)
800
113k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#5}::{closure#0}, combine::parser::combinator::Either<combine::parser::token::Produce<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#5}::{closure#0}::{closure#0}>, combine::parser::combinator::Map<combine::parser::repeat::CountMinMax<alloc::vec::Vec<redis::types::Value>, combine::parser::combinator::Opaque<redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}, combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, combine::parser::combinator::AnySendSyncPartialState>>, redis::types::Value::Array>>>
Line
Count
Source
792
118k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
118k
where
794
118k
    Input: Stream,
795
118k
    F: FnMut(&mut P::Output) -> N,
796
118k
    P: Parser<Input>,
797
118k
    N: Parser<Input>,
798
{
799
118k
    ThenPartial(p, f)
800
118k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#7}::{closure#0}, combine::parser::combinator::Either<combine::parser::combinator::Map<combine::parser::repeat::CountMinMax<alloc::vec::Vec<redis::types::Value>, combine::parser::combinator::Opaque<redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}, combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, combine::parser::combinator::AnySendSyncPartialState>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#7}::{closure#0}::{closure#0}>, combine::parser::error::Unexpected<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, &str>>>
Line
Count
Source
792
230k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
230k
where
794
230k
    Input: Stream,
795
230k
    F: FnMut(&mut P::Output) -> N,
796
230k
    P: Parser<Input>,
797
230k
    N: Parser<Input>,
798
{
799
230k
    ThenPartial(p, f)
800
230k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#8}::{closure#0}, combine::parser::combinator::Either<combine::parser::combinator::Map<combine::parser::repeat::CountMinMax<alloc::vec::Vec<redis::types::Value>, combine::parser::combinator::Opaque<redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}, combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, combine::parser::combinator::AnySendSyncPartialState>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#8}::{closure#0}::{closure#0}>, combine::parser::error::Unexpected<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, &str>>>
Line
Count
Source
792
88.5k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
88.5k
where
794
88.5k
    Input: Stream,
795
88.5k
    F: FnMut(&mut P::Output) -> N,
796
88.5k
    P: Parser<Input>,
797
88.5k
    N: Parser<Input>,
798
{
799
88.5k
    ThenPartial(p, f)
800
88.5k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#9}::{closure#0}, combine::parser::combinator::Either<combine::parser::token::Produce<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#9}::{closure#0}::{closure#0}>, combine::parser::combinator::Map<combine::parser::repeat::CountMinMax<alloc::vec::Vec<redis::types::Value>, combine::parser::combinator::Opaque<redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}, combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, combine::parser::combinator::AnySendSyncPartialState>>, redis::types::Value::Set>>>
Line
Count
Source
792
52.4k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
52.4k
where
794
52.4k
    Input: Stream,
795
52.4k
    F: FnMut(&mut P::Output) -> N,
796
52.4k
    P: Parser<Input>,
797
52.4k
    N: Parser<Input>,
798
{
799
52.4k
    ThenPartial(p, f)
800
52.4k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::combinator::AndThen<combine::parser::combinator::AndThen<combine::parser::range::Recognize<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::sequence::With<combine::parser::byte::take_until_bytes<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, combine::parser::combinator::Map<combine::parser::range::Take<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#0}>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#0}::{closure#1}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#2}::{closure#0}>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}, combine::parser::combinator::Either<combine::parser::token::Produce<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}::{closure#0}>, combine::parser::combinator::AndThen<combine::parser::repeat::CountMinMax<alloc::vec::Vec<redis::types::Value>, combine::parser::combinator::Opaque<redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}, combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, redis::types::Value, combine::parser::combinator::AnySendSyncPartialState>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#1}::{closure#10}::{closure#0}::{closure#1}>>>
Line
Count
Source
792
169k
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
169k
where
794
169k
    Input: Stream,
795
169k
    F: FnMut(&mut P::Output) -> N,
796
169k
    P: Parser<Input>,
797
169k
    N: Parser<Input>,
798
{
799
169k
    ThenPartial(p, f)
800
169k
}
combine::parser::sequence::then_partial::<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, combine::parser::token::Any<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>, redis::parser::value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>>::{closure#0}::{closure#0}, combine::parser::combinator::Either<combine::parser::error::Unexpected<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, u8, &str>, combine::parser::token::Value<combine::stream::easy::Stream<combine::stream::MaybePartialStream<&[u8]>>, u8>>>
Line
Count
Source
792
8.60M
pub fn then_partial<Input, P, F, N>(p: P, f: F) -> ThenPartial<P, F>
793
8.60M
where
794
8.60M
    Input: Stream,
795
8.60M
    F: FnMut(&mut P::Output) -> N,
796
8.60M
    P: Parser<Input>,
797
8.60M
    N: Parser<Input>,
798
{
799
8.60M
    ThenPartial(p, f)
800
8.60M
}
Unexecuted instantiation: combine::parser::sequence::then_partial::<_, _, _, _>
801
802
#[cfg(all(feature = "std", test))]
803
mod tests {
804
805
    use crate::parser::{token::any, EasyParser};
806
807
    #[test]
808
    fn sequence_single_parser() {
809
        assert!((any(),).easy_parse("a").is_ok());
810
    }
811
}
812
813
#[derive(Copy, Clone)]
814
pub struct ThenRef<P, F>(P, F);
815
impl<Input, P, N, F> Parser<Input> for ThenRef<P, F>
816
where
817
    Input: Stream,
818
    F: FnMut(&P::Output) -> N,
819
    P: Parser<Input>,
820
    N: Parser<Input>,
821
{
822
    type Output = (P::Output, N::Output);
823
    type PartialState = (
824
        P::PartialState,
825
        Option<(bool, P::Output, N)>,
826
        N::PartialState,
827
    );
828
829
    parse_mode!(Input);
830
    #[inline]
831
0
    fn parse_mode_impl<M>(
832
0
        &mut self,
833
0
        mut mode: M,
834
0
        input: &mut Input,
835
0
        state: &mut Self::PartialState,
836
0
    ) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
837
0
    where
838
0
        M: ParseMode,
839
    {
840
0
        let (ref mut p_state, ref mut n_parser_cache, ref mut n_state) = *state;
841
842
0
        if mode.is_first() || n_parser_cache.is_none() {
843
0
            debug_assert!(n_parser_cache.is_none());
844
845
0
            let (value, committed) = match self.0.parse_mode(mode, input, p_state) {
846
0
                PeekOk(value) => (value, false),
847
0
                CommitOk(value) => (value, true),
848
849
0
                PeekErr(err) => return PeekErr(err),
850
0
                CommitErr(err) => return CommitErr(err),
851
            };
852
853
0
            let parser = (self.1)(&value);
854
0
            *n_parser_cache = Some((committed, value, parser));
855
856
0
            mode.set_first();
857
0
        }
858
859
0
        let result = n_parser_cache
860
0
            .as_mut()
861
0
            .unwrap()
862
0
            .2
863
0
            .parse_committed_mode(mode, input, n_state);
864
0
        match result {
865
0
            PeekOk(x) => {
866
0
                let (committed, in_value, _) = n_parser_cache.take().unwrap();
867
0
                if committed {
868
0
                    CommitOk((in_value, x))
869
                } else {
870
0
                    PeekOk((in_value, x))
871
                }
872
            }
873
0
            CommitOk(x) => {
874
0
                let (_, in_value, _) = n_parser_cache.take().unwrap();
875
0
                *n_parser_cache = None;
876
0
                CommitOk((in_value, x))
877
            }
878
0
            PeekErr(x) => {
879
0
                let (committed, _, _) = n_parser_cache.take().unwrap();
880
0
                *n_parser_cache = None;
881
0
                if committed {
882
0
                    CommitErr(x.error)
883
                } else {
884
0
                    PeekErr(x)
885
                }
886
            }
887
0
            CommitErr(x) => CommitErr(x),
888
        }
889
0
    }
890
891
0
    fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>) {
892
0
        self.0.add_error(errors);
893
0
    }
894
}
895
896
/// Equivalent to [`p.then_ref(f)`].
897
///
898
/// [`p.then_ref(f)`]: ../trait.Parser.html#method.then
899
0
pub fn then_ref<Input, P, F, N>(p: P, f: F) -> ThenRef<P, F>
900
0
where
901
0
    Input: Stream,
902
0
    F: FnMut(&P::Output) -> N,
903
0
    P: Parser<Input>,
904
0
    N: Parser<Input>,
905
{
906
0
    ThenRef(p, f)
907
0
}