pub struct SeparatedSeqAccept<'o, O, Intro, Sep> {
pub output: &'o mut O,
pub intro: Intro,
pub separator: Sep,
pub wrote_any: bool,
}Expand description
A general purpose sequence acceptor that tracks whether any element is written and can write a separator between each element, in addition to an optional intro at the beginning.
Fields§
§output: &'o mut OThe output.
intro: IntroThe intro. Must be writable
separator: SepThe separator. Must be writable
wrote_any: boolWhether this instance wrote anything. Should be initially set to false.
Implementations§
Source§impl<'o, O, Intro, Sep> SeparatedSeqAccept<'o, O, Intro, Sep>
impl<'o, O, Intro, Sep> SeparatedSeqAccept<'o, O, Intro, Sep>
Source§impl<'o, O, Sep> SeparatedSeqAccept<'o, O, NoOp, Sep>
impl<'o, O, Sep> SeparatedSeqAccept<'o, O, NoOp, Sep>
Source§impl<'o, O> SeparatedSeqAccept<'o, O, NoOp, Str<&'static str>>
impl<'o, O> SeparatedSeqAccept<'o, O, NoOp, Str<&'static str>>
Sourcepub fn comma_separated(output: &'o mut O) -> Self
pub fn comma_separated(output: &'o mut O) -> Self
Makes a sink for sequences that separates by , .